Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$line may or may not have anything following it, or it may have one or more whitespace characters after matching $1.if ($line =~ /(.*?)\s*?(.*?$)/) { $grp = $1; $dsc = $2; }
What's wrong with this? Here's some sample data:
The alt.* entries are matched, however the microsoft.* are not.alt.philosophy.jarf The Jarf philosphy/metaphysics/religion/cultur +e. alt.philosophy.objectivism A product of the Ayn Rand corporation. alt.philosophy.zen Meditating on how the alt.* namespace works. microsoft.public.win95.setup microsoft.public.win95.shellui microsoft.public.win95.win95applets
Edit: chipmunk 2002-01-09
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex problem
by japhy (Canon) on Jan 10, 2002 at 00:26 UTC | |
by Anonymous Monk on Jan 10, 2002 at 00:44 UTC |