in reply to Multiple regexs into single combined regex using lookaheads
#!/usr/bin/perl use strict; use warnings; for (<DATA>) { chomp; print "Match: $_\n" if /^(?=.*name=bob)(?!.*flags=.*?cat.*?;)/; } __DATA__ name=bob;flags=human;age=10 name=tiddles;flags=cat,black;age=3 name=bob;flags=cat,white;age=6
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Multiple regexs into single combined regex using lookaheads
by mxb (Pilgrim) on Apr 17, 2018 at 08:10 UTC | |
by AnomalousMonk (Archbishop) on Apr 17, 2018 at 15:09 UTC |