Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. about regular expression validation

about regular expression validation

Scheduled Pinned Locked Moved ASP.NET
regexhelptutorial
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A abolibapat7

    gud afternoon i have a problem i have a taextbox and i want to enter in it only 2 digits or 11 digits example 12 valid 123 invalid 12345678912 valid 123456789123 invalid plz. rply its urgrnt

    G Offline
    G Offline
    Gamzun
    wrote on last edited by
    #2

    \d\d|[0-9]*9

    G A 2 Replies Last reply
    0
    • G Gamzun

      \d\d|[0-9]*9

      G Offline
      G Offline
      Gamzun
      wrote on last edited by
      #3

      \d\d|[0-9]{11} sorry my mistake

      1 Reply Last reply
      0
      • G Gamzun

        \d\d|[0-9]*9

        A Offline
        A Offline
        abolibapat7
        wrote on last edited by
        #4

        thx sir but i think this will take 9 digits i want either 2 digits or 11 digits not in betewwen them 12 valid 1234 invalid 12345678912 valid 123456789123 invalid

        G M 2 Replies Last reply
        0
        • A abolibapat7

          thx sir but i think this will take 9 digits i want either 2 digits or 11 digits not in betewwen them 12 valid 1234 invalid 12345678912 valid 123456789123 invalid

          G Offline
          G Offline
          Gamzun
          wrote on last edited by
          #5

          did you try that? I guess you didn't, there's a pipeline in between \d\d [0-9]{11} it will allow either 2 or 11 digits only

          1 Reply Last reply
          0
          • A abolibapat7

            thx sir but i think this will take 9 digits i want either 2 digits or 11 digits not in betewwen them 12 valid 1234 invalid 12345678912 valid 123456789123 invalid

            M Offline
            M Offline
            m dhu
            wrote on last edited by
            #6

            you can use 2 validators

            G 1 Reply Last reply
            0
            • M m dhu

              you can use 2 validators

              G Offline
              G Offline
              Gamzun
              wrote on last edited by
              #7

              why use two when one can do the same work

              A 1 Reply Last reply
              0
              • G Gamzun

                why use two when one can do the same work

                A Offline
                A Offline
                abolibapat7
                wrote on last edited by
                #8

                how?????????????

                A 1 Reply Last reply
                0
                • A abolibapat7

                  how?????????????

                  A Offline
                  A Offline
                  abolibapat7
                  wrote on last edited by
                  #9

                  ur suggestion is not working dude!!!!!!!!!!!

                  G 1 Reply Last reply
                  0
                  • A abolibapat7

                    ur suggestion is not working dude!!!!!!!!!!!

                    G Offline
                    G Offline
                    Gamzun
                    wrote on last edited by
                    #10

                    \d\d|[0-9]{11} did you try this one?

                    1 Reply Last reply
                    0
                    • A abolibapat7

                      gud afternoon i have a problem i have a taextbox and i want to enter in it only 2 digits or 11 digits example 12 valid 123 invalid 12345678912 valid 123456789123 invalid plz. rply its urgrnt

                      G Offline
                      G Offline
                      gg4237
                      wrote on last edited by
                      #11

                      \d{2}|\d{11} Regex cheatsheet link

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups