I am trying to catch all these numbers with a regex but I can't find a pattern.
Criteria for numbers:
it may be that before or after the phone number you have text.
Regex:
\b[\+]?[(]?[0-9]{2,6}[)]?[-\s\.]?[-\s\/\.0-9]{3,15}\b
Sample phone Numbers:
00491234567890
+491234567890
0123-4567890
0123 4567 789
0123 456 7890
0123 45 67 789
+490123 4567 789
+490123 456 7890
+49 123 45 67 789
123 4567 789
123 456 7890
123 45 67 789
+49 1234567890
+491234567890
0049 1234567890
0049 1234 567 890
(0049)1234567890
(+49)1234567890
(0049) 1234567890
(+49) 1234567890
text text (0049) 1234567890 text text
text text (+49) 1234567890 text text
Thanks.
Mobile Number validation criteria: The first digit should contain number between 7 to 9. The rest 9 digit can contain any number between 0 to 9. The mobile number can have 11 digits also by including 0 at the starting. The mobile number can be of 12 digits also by including 91 at the starting.
I've written this regex to find phone numbers:
(\(?(0{1,2}|\+)\d{1,2}\)?)?([ -]*\d+)+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With