Hi All,
I'm a newbie to RegExp
i need to get a word from a sentence after a particular word
(Here i need to get every word after the keyword "NOT" )
output should be;-
hi i love toys
Thanks in advance,
Sarav
"hi" does not come after "NOT".
But, have you already tried something yourself? If so, could you post it and tell on what input it failed?
Thanks.
I tried with,
str = "hi, NOT i NOT love NOT toys"
str.scan(/NOT (.*?) /)
But i cant get the exact result. I need the words which are come after "NOT" .
is the any particular reason you are trying to use a regex for this? Why not just do a string replace and replace NOT with an empty string?
If your problem is more complex than that would you please read our Posting Guidelines http://regexadvice.com/forums/thread/47451.aspx and ask your question again following them as much as possible?