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. General Programming
  3. C#
  4. How to find a exact word using regular expression

How to find a exact word using regular expression

Scheduled Pinned Locked Moved C#
databaseregextutorial
6 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.
  • N Offline
    N Offline
    NK7
    wrote on last edited by
    #1

    Hi all I have a doubt how to find a word exactly using regular expression. Ex:- While supplying some query "select * from tablename" how to find "select" word alone using regular expression kesavan

    G L N 3 Replies Last reply
    0
    • N NK7

      Hi all I have a doubt how to find a word exactly using regular expression. Ex:- While supplying some query "select * from tablename" how to find "select" word alone using regular expression kesavan

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

      Why would you use a regular expression for that? A regular string operation is simpler and faster.

      --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

      N 1 Reply Last reply
      0
      • G Guffa

        Why would you use a regular expression for that? A regular string operation is simpler and faster.

        --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

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

        No guffa I have a situation to use regular expression kesavan

        G 1 Reply Last reply
        0
        • N NK7

          No guffa I have a situation to use regular expression kesavan

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

          NK7 wrote:

          I have a situation to use regular expression

          That sentence doesn't really make sense, but I guess that you have some reason... Just use the Regex.Escape method to turn a string into a regular expression pattern.

          --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

          1 Reply Last reply
          0
          • N NK7

            Hi all I have a doubt how to find a word exactly using regular expression. Ex:- While supplying some query "select * from tablename" how to find "select" word alone using regular expression kesavan

            L Offline
            L Offline
            laserbaronen
            wrote on last edited by
            #5

            \bselect\b

            fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.

            1 Reply Last reply
            0
            • N NK7

              Hi all I have a doubt how to find a word exactly using regular expression. Ex:- While supplying some query "select * from tablename" how to find "select" word alone using regular expression kesavan

              N Offline
              N Offline
              Nitin Pakhide
              wrote on last edited by
              #6

              ^select$

              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