Security

last person joined: 5 hours ago 

Enterprise security using ClearPass Policy Management, ClearPass Security Exchange, IntroSpect, VIA, 360 Security Exchange, Extensions and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Phone number validation

Jump to Best Answer
  • 1.  Phone number validation

    Posted Feb 28, 2013 09:47 AM

    Hi,

     

    To check the guest's phone numbers, I use the validator "NwaSmsIsValidPhoneNumber". It works fine but now I need to force guests to add a + before the number. Like +044234657890

     

    How can I do this ?

     

    Thanks

     

    Dimitri



  • 2.  RE: Phone number validation
    Best Answer

    Posted Feb 28, 2013 12:55 PM

    Change the Validator to IsRegExMatch and use this regex:

     

    ^\+(?:[0-9] ?){6,14}[0-9]$

     

    That should enforce the E.164 standard.



  • 3.  RE: Phone number validation

    Posted Mar 01, 2013 01:59 AM

    Thanks, I will try it.

     

    Dimitri



  • 4.  RE: Phone number validation

    Posted Mar 07, 2013 03:45 AM

    A fast feedback, working fine thanks.

     

    Dimitri



  • 5.  RE: Phone number validation

    Posted Apr 16, 2013 10:44 AM

    Hi,

     

    I need a new regex that checks that there are only numbers with no spaces and max lenght is 15 digits. Anyone can help me, thanks.

     

    Regards

     

    Dimitri



  • 6.  RE: Phone number validation

    Posted Apr 16, 2013 02:50 PM
    Many regex testers and libraries out there mate. [0-9]{15} is the simple answer.


  • 7.  RE: Phone number validation

    Posted Apr 17, 2013 02:22 AM

    Ok thanks, it's allright.



  • 8.  RE: Phone number validation

    Posted Apr 17, 2013 03:43 AM
    Try using /^\d\d\d-\d\d\d-\d\d\d\d$/ You just need to remove the - if you don't want the standard US format


  • 9.  RE: Phone number validation

    Posted Apr 17, 2013 03:44 AM
      |   view attached