in reply to Re^5: Regex match at the beginning or end of string
in thread Regex match at the beginning or end of string
But, I challenge you to construct the regex(es) required to match the terms: the, quick, brown, fox, jumps, over, the, lazy, dog, in any ordering, using some other technique.
Ormy @pats = qw[the quick brown fox jumps over the lazy dog]; my $str = "...."; my $matched = 1; foreach my $pat (@pats) { last unless $matched &&= $str =~ /$pat/; }
my @pats = qw[the quick brown fox jumps over the lazy dog]; my $str = "...."; my $matched = !grep {$str !~ /$_/} @pats;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Regex match at the beginning or end of string
by BrowserUk (Patriarch) on Feb 20, 2011 at 12:49 UTC | |
by JavaFan (Canon) on Feb 20, 2011 at 15:46 UTC | |
by BrowserUk (Patriarch) on Feb 20, 2011 at 18:45 UTC | |
by JavaFan (Canon) on Feb 20, 2011 at 22:07 UTC | |
|
Re^7: Regex match at the beginning or end of string
by BrowserUk (Patriarch) on Feb 20, 2011 at 11:21 UTC |