Regex not operator

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 … Read more

Why are regular expressions so controversial? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 years ago. Improve this question When exploring regular expressions (otherwise known as RegEx-es), there are many individuals who seem to see … Read more

Search and replace in bash using regular expressions

I’ve seen this example: hello=ho02123ware38384you443d34o3434ingtod38384day echo ${hello//[0-9]/} Which follows this syntax: ${variable//pattern/replacement} Unfortunately the pattern field doesn’t seem to support full regex syntax (if I use . or \s, for example, it tries to match the literal characters). How can I search/replace a string using full regex syntax? 9 Answers 9