Phone Number vallidation for German phone number.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spaleaplli1
    New Member
    • Jun 2016
    • 11

    #16
    i have to restrict at-least this number.
    00 44 161 1234567

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #17
      with a bit of preparation, my RegExp works.

      Comment

      • spaleaplli1
        New Member
        • Jun 2016
        • 11

        #18
        i am using this regex(^((?:\+49 |\+89)?\s*(?:\( ([89|49])\d+\)\s*(?:[\/–-]\s*)?)?\d+(?:\s *(?:[\s\/–-]\s*)(?!44{1,2}) \d+)*)$) it is working fine but i have one query.

        suppose if the number does not allow using this regex(?!44) .If we allow the number what we have to use.

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #19
          youre making it unnecessarily complicated with this RegExp. there is no need to regard spaces, parentheses, hyphens, dots, and whatnot in a number validation.

          the RegExp I posted in #7 is sufficient.

          Comment

          • spaleaplli1
            New Member
            • Jun 2016
            • 11

            #20
            Thanks Dormilich, for supporting and much appreciated. if the number having like 00 44 161 1234567.this number has 00 44 has uk code right, this one i have to restrict.

            Comment

            Working...