Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello
I'm trying to match (for replace) a text line that doesn't start with one of two words. The only thing about "not" I could find for replace purposes in regex was the ^abc.. syntax which only match 1 char and never longer strings. Is there a way to do this ? I'm expecting something like s/ \n !($word1|$word2) .* \n / $replacement /x or maybe something like s/ $ !($word1|$word2) .* \n / $replacement /x or maybe even s/ ^ ($word1|$word2){0} .* \n / $replacement /x am I close ? There got to be a better way. thx In reply to how to use "NOT" in regex by palkia
|
|