How to find a exact word using regular expression
-
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
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
-
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
-
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
-
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
\bselect\b
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
-
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
^select$