in reply to Need RegExp help - doing an AND match
Here's one way to do it with regex:
use strict; use warnings; my $re = qr{ ^ (?=.*foo) (?=.*bar) }x; while (my $line = <DATA>) { print $line if $line =~ $re; } __DATA__ foo bar foo bar bar foo abc foo bar
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Need RegExp help - doing an AND match
by Anonymous Monk on Jul 01, 2007 at 14:14 UTC | |
by lidden (Curate) on Jul 01, 2007 at 18:08 UTC |
In Section
Seekers of Perl Wisdom