Is there an NOT operator in Regexes?
Like in that string : "(2001) (asdf) (dasd1123_asd 21.01.2011 zqge)(dzqge) name (20019)"
I want to delete all \([0-9a-zA-z _\.\-:]*\)
but not the one where it is a year: (2001)
.
So what the regex should return must be: (2001) name
.
NOTE: something like \((?![\d]){4}[0-9a-zA-z _\.\-:]*\)
does not work for me (the (20019)
somehow also matches...)
Not quite, although generally you can usually use some workaround on one of the forms
[^abc]
, which is character by character not a
or b
or c
, a(?!b)
, which is a
not followed by b
(?<!a)b
, which is b
not preceeded by a