I would like to exclude any line in the document that has /!ut/
I know /
is a special character in regex so tried below and does not seem to be working as expected.
//!ut//
//(!ut)//
Any help is appreciated.
I would like to exclude any line in the document that has /!ut/
I know /
is a special character in regex so tried below and does not seem to be working as expected.
//!ut//
//(!ut)//
Any help is appreciated.
You don't have to escape the forward slash in a regex, but you do when it is used as a delimiter
If you change your regexes to match a single forward slash with or without escaping them, /!ut/
would match that literally and /(!ut)/
would match that literally with !ut
in a capturing group.
What you could do to exclude any line that contains /!ut/
is to use a negative lookahead (?!.*/!ut/)
to make sure that what follows is not /!ut/
and then match the rest of the line using .*$
^(?!.*\/!ut\/).+$