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. Simple Regular Expression? [modified]

Simple Regular Expression? [modified]

Scheduled Pinned Locked Moved Web Development
tutorialvisual-studioregexquestion
7 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.
  • N Offline
    N Offline
    neo_6053
    wrote on last edited by
    #1

    How to make a textbox not accept certain words? Example : can not contain word "dog" in a string I hv tried negative lookahead (?!regexp) and many other method i found through google, but none of them work. I'm using RegularExpressionValidator in VS 2003. Izzit related? -- modified at 2:01 Wednesday 27th September, 2006

    _ J 2 Replies Last reply
    0
    • N neo_6053

      How to make a textbox not accept certain words? Example : can not contain word "dog" in a string I hv tried negative lookahead (?!regexp) and many other method i found through google, but none of them work. I'm using RegularExpressionValidator in VS 2003. Izzit related? -- modified at 2:01 Wednesday 27th September, 2006

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      You can use javascript regular exepression for that purpose: here you can get the required help regarding javascript regular expression: http://www.webreference.com/js/column5/[^] http://www.javascriptkit.com/javatutors/re.shtml[^] :)

      Best Regards, Apurva Kaushal

      N 1 Reply Last reply
      0
      • _ _AK_

        You can use javascript regular exepression for that purpose: here you can get the required help regarding javascript regular expression: http://www.webreference.com/js/column5/[^] http://www.javascriptkit.com/javatutors/re.shtml[^] :)

        Best Regards, Apurva Kaushal

        N Offline
        N Offline
        neo_6053
        wrote on last edited by
        #3

        Anyway, Thx for your help. But i'm quite new to regular expression. I still not sure what to put. Appreciate if someone can give me the solution. Thx

        _ 1 Reply Last reply
        0
        • N neo_6053

          Anyway, Thx for your help. But i'm quite new to regular expression. I still not sure what to put. Appreciate if someone can give me the solution. Thx

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          It depends what exactly you want your user not to put in the textbox. I hope it won't be "dog" as you mentioned. :)

          Best Regards, Apurva Kaushal

          N 1 Reply Last reply
          0
          • N neo_6053

            How to make a textbox not accept certain words? Example : can not contain word "dog" in a string I hv tried negative lookahead (?!regexp) and many other method i found through google, but none of them work. I'm using RegularExpressionValidator in VS 2003. Izzit related? -- modified at 2:01 Wednesday 27th September, 2006

            J Offline
            J Offline
            just3ala2
            wrote on last edited by
            #5

            Hi there guess this is a helpful link [^] it contains many useful information about regular expressions. Best Regards 3ala2 :)

            1 Reply Last reply
            0
            • _ _AK_

              It depends what exactly you want your user not to put in the textbox. I hope it won't be "dog" as you mentioned. :)

              Best Regards, Apurva Kaushal

              N Offline
              N Offline
              neo_6053
              wrote on last edited by
              #6

              haha, it just an example. Finally i found the solution. ^((?!(illegal)).)*$ but regular expression is case sensitive. that's mean words like "illegAL" will not work... i think i better use back the .net code... anyway, thx ..

              _ 1 Reply Last reply
              0
              • N neo_6053

                haha, it just an example. Finally i found the solution. ^((?!(illegal)).)*$ but regular expression is case sensitive. that's mean words like "illegAL" will not work... i think i better use back the .net code... anyway, thx ..

                _ Offline
                _ Offline
                _AK_
                wrote on last edited by
                #7

                neo_6053 wrote:

                regular expression is case sensitive

                ya by default it is case sensitive but you can make that case insensitive. You just to set the flag. Here you can get the detsila: http://www.evolt.org/article/Regular_Expressions_in_JavaScript/17/36435/[^]

                neo_6053 wrote:

                anyway, thx ..

                always welcome.. :)

                Best Regards, Apurva Kaushal

                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