nutshell has asked for the wisdom of the Perl Monks concerning the following question:
Keep in mind that the very last line wont have a comma at the end.key => 44, "key" => "fun. \"yes\" 'fun'", 'key' => 'yahoo\' "fun"'
I'm currently using $text =~ s/'?(\w+)'?\s+=>\s+'?([^']+)'?,?\n/$Data{$1} = $2;/seg; but as you can see it's too limited.
--nutshell
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexing a hash line thing
by zigdon (Deacon) on Oct 21, 2002 at 14:35 UTC | |
by nutshell (Beadle) on Oct 21, 2002 at 14:40 UTC | |
|
(tye)Re: Regexing a hash line thing
by tye (Sage) on Oct 21, 2002 at 15:15 UTC | |
|
Re: (nrd) Regexing a hash line thing
by newrisedesigns (Curate) on Oct 21, 2002 at 14:41 UTC | |
|
Re: Regexing a hash line thing
by broquaint (Abbot) on Oct 21, 2002 at 15:22 UTC | |
|
Re: Regexing a hash line thing
by nutshell (Beadle) on Oct 21, 2002 at 15:04 UTC | |
|
Re: Regexing a hash line thing
by sauoq (Abbot) on Oct 21, 2002 at 19:59 UTC | |
|
Re: Regexing a hash line thing
by nutshell (Beadle) on Oct 21, 2002 at 14:30 UTC |