Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regular expression help

by QM (Parson)
on Aug 17, 2005 at 21:40 UTC ( #484612=note: print w/replies, xml ) Need Help??


in reply to Regular expression help

First, be careful about "odd" names, such as "Jean-Michel Paris" and "Mary de Konig".

I often do quick and dirty parsing jobs like this:

my $name = qr/([\w_-=]+)\s*/; my $enum = qr/(([\d.-+,])\s*/; <p> while ( <> ) { if ( my @captures = /$name$name$enum/ ) { do_something_here(@captures); } }

-QM
--
Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://484612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2021-01-20 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?