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. How to create a regular expression validation for numbers from 1 to 4000 ?

How to create a regular expression validation for numbers from 1 to 4000 ?

Scheduled Pinned Locked Moved ASP.NET
cssregexhelptutorialquestion
6 Posts 5 Posters 1 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.
  • M Offline
    M Offline
    meeram395
    wrote on last edited by
    #1

    I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000. ValidationExpression="\d{1,4000}" any body please help?

    Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

    A C S V 4 Replies Last reply
    0
    • M meeram395

      I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000. ValidationExpression="\d{1,4000}" any body please help?

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      see this. I think after reading this you can make it urself.. http://www.regular-expressions.info/numericranges.html[^] :thumbsup::thumbsup:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      1 Reply Last reply
      0
      • M meeram395

        I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000. ValidationExpression="\d{1,4000}" any body please help?

        Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

        C Offline
        C Offline
        Coding C
        wrote on last edited by
        #3

        Why do you want regular expression for this?? simply check if number is between 1 and 4000. :)

        Coding C# ExciteTemplate

        1 Reply Last reply
        0
        • M meeram395

          I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000. ValidationExpression="\d{1,4000}" any body please help?

          Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

          S Offline
          S Offline
          SmartAvi
          wrote on last edited by
          #4

          Hi... you can use "Range Validator" for this

          1 Reply Last reply
          0
          • M meeram395

            I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000. ValidationExpression="\d{1,4000}" any body please help?

            Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

            V Offline
            V Offline
            vaibhav csmiet
            wrote on last edited by
            #5

            Search This on Net :laugh:

            M 1 Reply Last reply
            0
            • V vaibhav csmiet

              Search This on Net :laugh:

              M Offline
              M Offline
              meeram395
              wrote on last edited by
              #6

              Thank you for your reply. I don't know why you have taken 7 months time to reply for this message, if you really want to answer this question. This is already resolved. Anyway, thanks for this very simple but nonsensical reply. :laugh:

              Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

              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