L
Laurent Schneider
I need to find every line containing abc followed by anything different
than 123 and 456
something like in shell the
abc!(123|456)
I tried the following :
$ cat x
abc123
abc123 abc456
abc456 abc789
abc789
abc453
$ perl -ne
'/abc([^14]..|.[^25].|..[^36]|126|153|156|423|426|453|.$|..$)/&&print'
x
abc456 abc789
abc789
abc453
$
which works ok for 123 and 456 but is a nightmare to code, especially
with many groups of different lengths
thanks for help
than 123 and 456
something like in shell the
abc!(123|456)
I tried the following :
$ cat x
abc123
abc123 abc456
abc456 abc789
abc789
abc453
$ perl -ne
'/abc([^14]..|.[^25].|..[^36]|126|153|156|423|426|453|.$|..$)/&&print'
x
abc456 abc789
abc789
abc453
$
which works ok for 123 and 456 but is a nightmare to code, especially
with many groups of different lengths
thanks for help