How can I use Regex to check if multiple strings appear at the start of a phone number

I’m trying to check if a phone number has either of the following 031, 039, 076, 077, 078 at the start. I’m able to check if one of them occurs once
(096){1} but not able to check the input if any of them occur at least once.
How would I check if any of the sequences appear ?

>Solution :

You may use an alternation here. Assuming the phone numbers were all digits, and you had no other requirements, you could use:


Leave a Reply