Answer the question
In order to leave comments, you need to log in
Regular expression
Hello. There is a regular expression:
^(?:(?!039|050|063|066|067|068|091|092|093|094|095|096|097|098|099|00).)*$
Its task is in order not to miss calls to numbers of mobile operators in Ukraine and abroad (00).
The problem is that, among other things, calls do not go through to numbers in the body of which the specified substrings occur. For example, the call does not go through to the number 039 5420245, which is good, but it will not go through to the number 0445421 067 either .
Answer the question
In order to leave comments, you need to log in
The problem is the following (for convenience, I'll shorten your long or to one option):
^(?:(?!00).)*$
The check (?! ...) is inside the group with the * sign, that is, it is performed every time when the reg Exp engine jumps to the next character. For your case, this check should be taken out of the group (and the brackets of the group should be removed altogether - since only 1 element will remain in it):
^(?!00).*$
Why use regular expressions for this? I guess it's easier and faster to check with string functions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question