dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: regular expressions problem

  1. #1
    Join Date
    Dec 2011
    Posts
    28

    Lightbulb regular expressions problem

    Hi all,

    I created a regex for matching mobile number ..

    $search = preg_match_all("~(\d{1,}\s?|\d?\s?\(\d{1,}\)|\d{1,}-)?\s{0,}\d{1,}[.\s]?/?[.\-]?[.\s\-\s]?\d{1,}[.\s]?\d{1,}[.\s]?[.\-]?[.\s\-\s]?\d{1,}~",$text,$matches);




    It works fine with most phone numbers, but sometimes it doesn't work ..
    This is a sample of a working number : + 2 010 5646024
    and this is a sample of a not working number : + 2 385 230 61
    I don't understand why the second number + 2 385 230 61 is not matched ...
    N.B When I add any integer to the second number , it works , eg + 2 385 230 611

    So how can I edit my regex to match the second number?

    Regards,

  2. #2
    Join Date
    Dec 2011
    Posts
    28
    no help ?

    I only want to edit the code to match also + 2 385 230 611

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles