SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 32 of 32
  1. #26
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Yup, that's much easier to read.

  2. #27
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    737
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Anything wrong in the following?

    ^(?:\+|00)[1-9][0-9]{10,15}$

  3. #28
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    No, not really.
    You should however be aware that writing \d, is the same as writing [0-9].

  4. #29
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    737
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    means \d is faster than [0-9] ?

  5. #30
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Nope, just more concise.

  6. #31
    SitePoint Guru phantom007's Avatar
    Join Date
    May 2008
    Posts
    737
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi Again


    I am using the following regex:
    Code:
    /^(?:\+|00)[1-9][0-9]{10,15}$/
    But it does not validate the following two numbers, any idea why?

    Code:
    005374152368
    +4865718575

    Thanks

  7. #32
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,265
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cancer10 View Post
    Hi Again


    I am using the following regex:
    Code:
    /^(?:\+|00)[1-9][0-9]{10,15}$/
    But it does not validate the following two numbers, any idea why?

    Code:
    005374152368
    +4865718575

    Thanks
    Your original post says the numbers should be between 11 - 16 chars (length excluding + and 00). These numbers are only 10 chars.
    "First make it work. Then make it better."


Bookmarks

Posting Permissions

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