Quote:
Originally Posted by Faki
I want to specifically know if there is a not match regex operator when I am interested in not matching only. In case of bash scripts.
|
There is a regex concept called negative lookaheads, which succeeds when its sub-expression cannot match.
Bash's regex engine doesn't support these, but both Perl's and Python's do.
There might potentially be workarounds depending on what specifically you are trying to do, but - given the frequency you've been asking regex questions - you need to consider if Bash is the right tool - and indeed whether regex is enough for whatever you're trying to achieve. (Some of your questions suggest you may want to look at
Antlr/
Bison/
etc.)