saintbrie has asked for the wisdom of the Perl Monks concerning the following question:
I just want it to match "the quick fox" (the spaces could be any gobbledygook at all, I'm parsing HTML and can't use HTML::Parser). What I get is "the dog and the bear are quick, but the quick fox"$text = "the dog and the bear are quick, but the quick fox is quicker" +; $re = "the\\b.*?quick\\b.*?fox"; print "it matches \n" if ($text =~ /($re)/sg); print $1 . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting the shortest match?
by Abigail-II (Bishop) on Jan 18, 2003 at 00:40 UTC | |
|
Re: Getting the shortest match?
by runrig (Abbot) on Jan 18, 2003 at 01:09 UTC | |
|
Re: Getting the shortest match?
by gjb (Vicar) on Jan 18, 2003 at 01:07 UTC | |
by saintbrie (Scribe) on Jan 18, 2003 at 04:45 UTC |