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

Regular Expression

Scheduled Pinned Locked Moved ASP.NET
regex
5 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.
  • S Offline
    S Offline
    samrat net
    wrote on last edited by
    #1

    Hello Friends i've a regular expression which take only +ve integer(0,1,2,.......) Expression="\d+$" but i want to ignore 0,i.e., it would take 1,2,3,......... pls give me expression with thanx

    C M G 3 Replies Last reply
    0
    • S samrat net

      Hello Friends i've a regular expression which take only +ve integer(0,1,2,.......) Expression="\d+$" but i want to ignore 0,i.e., it would take 1,2,3,......... pls give me expression with thanx

      C Offline
      C Offline
      c2423
      wrote on last edited by
      #2

      Off the top of my head, you'll need something like ^0 first (i.e. not "0"), but I'd need to look it up to get the exact syntax. Hope that helps, Chris [Edit: check out http://www.codeproject.com/KB/dotnet/expresso.aspx[^ ]

      S 1 Reply Last reply
      0
      • S samrat net

        Hello Friends i've a regular expression which take only +ve integer(0,1,2,.......) Expression="\d+$" but i want to ignore 0,i.e., it would take 1,2,3,......... pls give me expression with thanx

        M Offline
        M Offline
        meghamaharshi
        wrote on last edited by
        #3

        http://regexlib.com visit this link

        1 Reply Last reply
        0
        • C c2423

          Off the top of my head, you'll need something like ^0 first (i.e. not "0"), but I'd need to look it up to get the exact syntax. Hope that helps, Chris [Edit: check out http://www.codeproject.com/KB/dotnet/expresso.aspx[^ ]

          S Offline
          S Offline
          samrat net
          wrote on last edited by
          #4

          i m using following tag

          1 Reply Last reply
          0
          • S samrat net

            Hello Friends i've a regular expression which take only +ve integer(0,1,2,.......) Expression="\d+$" but i want to ignore 0,i.e., it would take 1,2,3,......... pls give me expression with thanx

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

            You don't need ^ and $ to mark the beginning and end when you use a regular expression in a validation control. Use this to match any integer from 1 and up: [1-9]|\d{2,}

            Despite everything, the person most likely to be fooling you next is yourself.

            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