0

I have phone numbers on the website that can be in the format: +48 123456789 48 123456789 123456789

plus, of course, dashes and parentheses, but here I will skip them.

PESEL numbers can also be found on the website - standard 11 characters from 0-9

I only want to select phone numbers, i.e. reject 11-character strings. I tried something like this and it doesn't work - i.e. I need a space at the end of the phone. How to get around this?

Code below:

/((\+?48 ?)?[1-9]{1}[0-9]{8})/igm   /*phone number*/

/((\+?48 ?)?[1-9]{1}[0-9]{8}([^(0-9){11}]))/igm /*here need space after phone number*/

I expect to find phone number, without need to give space after last digit.

blackmoon
  • 324
  • 6
  • 17

0 Answers0