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 to validate strings

Regular expression to validate strings

Scheduled Pinned Locked Moved ASP.NET
regexquestion
3 Posts 3 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.
  • M Offline
    M Offline
    mukkanti007
    wrote on last edited by
    #1

    All, I am looking for a regular expression for a string to allow alphabets ,digits and only special characters like underscore(_) and blank space. i tried using [0-9a-zA-Z]+$ but it accepts only digits and alphabets which is stops my functionality. my string should accept only _ and blank space no more special characters....... can some one suggest me the proper regular expression? Thanks, Mukkanti.

    Thanks Mukkanti

    M P 2 Replies Last reply
    0
    • M mukkanti007

      All, I am looking for a regular expression for a string to allow alphabets ,digits and only special characters like underscore(_) and blank space. i tried using [0-9a-zA-Z]+$ but it accepts only digits and alphabets which is stops my functionality. my string should accept only _ and blank space no more special characters....... can some one suggest me the proper regular expression? Thanks, Mukkanti.

      Thanks Mukkanti

      M Offline
      M Offline
      MidwestLimey
      wrote on last edited by
      #2

      [0-9a-zA-Z_\s]+$ I think should work, unless _ is a control character (I haven't had my coffee yet, so my mind isn't working well :D).

      10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011

      1 Reply Last reply
      0
      • M mukkanti007

        All, I am looking for a regular expression for a string to allow alphabets ,digits and only special characters like underscore(_) and blank space. i tried using [0-9a-zA-Z]+$ but it accepts only digits and alphabets which is stops my functionality. my string should accept only _ and blank space no more special characters....... can some one suggest me the proper regular expression? Thanks, Mukkanti.

        Thanks Mukkanti

        P Offline
        P Offline
        Perry Holman
        wrote on last edited by
        #3

        Here is a website regarding regular expression. Maybe you can find what you want. http://regexlib.com/[^]

        Welcome to www.softwaretree.net! You can find many excellent audio/video converter tools there!

        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