In an awk program , I'm trying to select the input from a line containing <<<local>>>
and the next line containing the pattern <<<XXXX>>>
, where
XXXX
will be anything else but local
.
<<<local>>>
line1
line2
line3
<<<XXXX>>>
The simplest awk code would be
$0=="<<<local>>>",/^<<<XXXX>>>$/ { ··· }
but XXXX
should be replaced with a proper regular expression to exclude local
.
As far I know, that can be done in python
(?!local)
and in Korn shell and other shells:
!(local)
but I have found nothing about this issue in the regex(7) man pages.
In order to bypass this handicap I use
$0=="<<<local>>>",/^<<<.+>>>$/ && $0!="<<<local>>>" { ··· }
but the crux of this question of mine is wether the awk
regex engine accepts somehow a word list to exclude, I mean, as a counterpart of word1|word2|word3
.