Saturday, 15 December 2018

php - Regex for this phone number?




(00355) XX-XXX-XXXX


So far I have this but I don't know how to express that first five digits must be 00355.



/^.d{2}.\d{3}.\d{4}.$/

Answer



/\(00355\)\s\d{2}-\d{3}-\d{3}/



should do the trick.



btw - try this tool: https://regex101.com/


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...