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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Regular Expression Problem

Regular Expression Problem

Scheduled Pinned Locked Moved ASP.NET
helpregex
3 Posts 2 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.
  • U Offline
    U Offline
    User 3450649
    wrote on last edited by
    #1

    Hi all i have a problem with regular expression,my requrment is start with I/i then five digit then . and then one digit for this i have write some expression var exp = new RegExp("^I|i\[0-9]*\\d{5}.[0-9]$"); but this expression is not wrking, can u help mee Thanks

    J 1 Reply Last reply
    0
    • U User 3450649

      Hi all i have a problem with regular expression,my requrment is start with I/i then five digit then . and then one digit for this i have write some expression var exp = new RegExp("^I|i\[0-9]*\\d{5}.[0-9]$"); but this expression is not wrking, can u help mee Thanks

      J Offline
      J Offline
      Jim Conigliaro
      wrote on last edited by
      #2

      The regular expression would be: (i|I)\d{5}\.\d (i|I) -> either a lower case or an upper case i \d{5} -> five sequential digits \. -> the decimal point \d - one digit so the fully escaped regex on .net would be var exp = new RegExp("(i|I)\\d{5}\\.\\d"); Note: you could also use the ignore case Regex option flag and just include the i instead of (i|I) P.S. I would recommend use of the Regex Coach - a nifty little tool for designing and testing regular expressions: http://www.weitz.de/regex-coach/[^]

      Jim Conigliaro jconigliaro@ieee.org
      http://www.jimconigliaro.com

      U 1 Reply Last reply
      0
      • J Jim Conigliaro

        The regular expression would be: (i|I)\d{5}\.\d (i|I) -> either a lower case or an upper case i \d{5} -> five sequential digits \. -> the decimal point \d - one digit so the fully escaped regex on .net would be var exp = new RegExp("(i|I)\\d{5}\\.\\d"); Note: you could also use the ignore case Regex option flag and just include the i instead of (i|I) P.S. I would recommend use of the Regex Coach - a nifty little tool for designing and testing regular expressions: http://www.weitz.de/regex-coach/[^]

        Jim Conigliaro jconigliaro@ieee.org
        http://www.jimconigliaro.com

        U Offline
        U Offline
        User 3450649
        wrote on last edited by
        #3

        Ya It's wrking fine , and thanks a lot.. , i also go with the same url for regular expression , thanks .

        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