Regular Expression Validation For Indian Phone Number and Mobile number

前端 未结 12 760
后悔当初
后悔当初 2020-12-01 09:26

I want to validate Indian phone numbers as well as mobile numbers. The format of the phone number and mobile number is as follows:

For land Line number



        
12条回答
  •  抹茶落季
    2020-12-01 10:07

    For land Line Number

    03595-259506
    03592 245902
    03598245785
    

    you can use this

    \d{5}([- ]*)\d{6}

    NEW for all ;)

    OLD: ((\+*)(0*|(0 )*|(0-)*|(91 )*)(\d{12}+|\d{10}+))|\d{5}([- ]*)\d{6}
    NEW: ((\+*)((0[ -]+)*|(91 )*)(\d{12}+|\d{10}+))|\d{5}([- ]*)\d{6}
    
    9775876662
    0 9754845789
    0-9778545896
    +91 9456211568
    91 9857842356
    919578965389
    
    03595-259506
    03592 245902
    03598245785
    

    this site is useful for me, and maby for you .;)http://gskinner.com/RegExr/

提交回复
热议问题