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. Regular expression in asp.net

Regular expression in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netregexquestion
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.
  • P Offline
    P Offline
    Pankaj Saha
    wrote on last edited by
    #1

    Hi I need a regular expression for 1.00E+05.. I am using [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|^$ but it is not working..its accepts any character after the numeric value i.e. its returns true for 100abcd, however this is wrong. Only a single e or E should accept.

    Pankaj

    OriginalGriffO 1 Reply Last reply
    0
    • P Pankaj Saha

      Hi I need a regular expression for 1.00E+05.. I am using [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|^$ but it is not working..its accepts any character after the numeric value i.e. its returns true for 100abcd, however this is wrong. Only a single e or E should accept.

      Pankaj

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Try: [-+]?([0-9]+)\.([0-9])+[eE][\+-]?[0-9][0-9]? I strongly recommend you get a copy of Expresso[^] - it makes working with regexes so much easier... [edit]eh up - one o me brackets vanished...it's back now![/edit]

      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      P 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Try: [-+]?([0-9]+)\.([0-9])+[eE][\+-]?[0-9][0-9]? I strongly recommend you get a copy of Expresso[^] - it makes working with regexes so much easier... [edit]eh up - one o me brackets vanished...it's back now![/edit]

        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

        P Offline
        P Offline
        Pankaj Saha
        wrote on last edited by
        #3

        Thanks for your help..but I need to allow blank also, means either there should be blank or valid value, but this expression does not allow blank, that's why I added |^$ at the end of the expression. But still not working properly. :((

        Pankaj

        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