Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Using a Regex to parse into keys

by Felonious (Chaplain)
on Oct 07, 2002 at 02:16 UTC ( #203234=note: print w/replies, xml ) Need Help??


in reply to Using a Regex to parse into keys

To do exactly what you asked for, in a non-flexible way...
#!/usr/bin/perl use Data::Dumper; my $text = join('', <DATA>); my %hash = ($text =~ /(\d+)\~\<font color="(#[0-9A-Fa-f]{6})"\>/g); print Dumper(\%hash); __DATA__ 4~<font color="#FF0000"><b>,</b></font> Some junk 5~<font color="#FF0200"><b>,</b></font> more junk 6~<font color="#FF03 +00"><b>,</b></font>sd 7~<font color="#FF0400"><b>,</b></font> last junk 99 8~<font color="#FF0500"><b>,</b></font>

[TINPC@perlcabal.com shh]$ su real

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://203234]
help
Chatterbox?
vrk takes a cookie from the platter on the sideboard.
Eily thinks vrk is a cookie monster
talexb thinks the term 'cookie monster' is unnecessarily drogatory ;) and takes a cookie as well. Mmmm. Delicious cookies.
[davido]: A tool as pretentious as Test::Perl::Critic ought not fail to install because one of its dependencies failed to pull in List::MoreUtils.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-04-25 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (458 votes). Check out past polls.