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. How to use Regular Expressions ?

How to use Regular Expressions ?

Scheduled Pinned Locked Moved ASP.NET
tutorialcsharpasp-netquestion
6 Posts 5 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.
  • V Offline
    V Offline
    vishalmishra
    wrote on last edited by
    #1

    i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc.. please give an example

    S M A D 4 Replies Last reply
    0
    • V vishalmishra

      i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc.. please give an example

      S Offline
      S Offline
      sstocker
      wrote on last edited by
      #2

      It sounds as though you could just use ASP.Net's built in validators - which will do phone number and email format validations for you with no extra code required. Scott Stocker

      V 1 Reply Last reply
      0
      • V vishalmishra

        i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc.. please give an example

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

        you can search the cp with Regular Expressions keyword and it will return to you a nice article called learn Regular Expressions in 30 minutes this will help you if you want to learn it by yourself .

        1 Reply Last reply
        0
        • S sstocker

          It sounds as though you could just use ASP.Net's built in validators - which will do phone number and email format validations for you with no extra code required. Scott Stocker

          V Offline
          V Offline
          vishalmishra
          wrote on last edited by
          #4

          well..not much idea abt the built in validators in ASP.NET.. really sorry...i m quite new to ASP.NET.. and suppose if i dont use the built in validators, then how to use other validators ?? please give example... thanks

          1 Reply Last reply
          0
          • V vishalmishra

            i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc.. please give an example

            A Offline
            A Offline
            Anish Gopi
            wrote on last edited by
            #5

            ASP.Net supports a RegularExpression Validator . Using RegularExpression validator We can validate a text box based on a particular format

            set controlToValidate to the textbox.
            set ValidationExpression (here we can select a predefined expression or create a custom one)

            .Net Namespace System.Text.RegularExpression supports a RegEx class to manage validation through code

            1 Reply Last reply
            0
            • V vishalmishra

              i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc.. please give an example

              D Offline
              D Offline
              DELETEUSER
              wrote on last edited by
              #6

              Go to Studio.Net IDE and select the reg exp control. Place it where you want your error msg to appear close to the control to validate. Edit the following properties for reg exp control 1) Error Msg 2) Control to Validate 3) Validation Expression That should do most of your job. Else reg exp is topic of research by itself...!!! ---------- user9 A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

              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