-1

I have a TextFormField for a phone number and I want to validate the input to match my RegEx to phone number value

the valid inputs are

075xxxxxxxx
077xxxxxxxx
078xxxxxxxx
079xxxxxxxx

I tried this r"^ (?:[0]7)?[0-9]{11}$" but its not working

any way to do it right?

Tabarek Ghassan
  • 716
  • 15
  • 28
  • a dup of the how to validate _ALL_ phone numbers in the world ? pretty arogant isin't it ? –  Jun 11 '20 at 22:57

1 Answers1

0

Match a zero, then a 7, then any of [5,7,8,9] then any 8 digits:

07[5789]\d{8}
Griffin
  • 13,184
  • 4
  • 29
  • 43