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

Re: regex capture and quantifiers

by 2teez (Priest)
on Apr 30, 2013 at 21:11 UTC ( #1031476=note: print w/ replies, xml ) Need Help??

in reply to regex capture and quantifiers

Something like this:

use warnings; use strict; my $str = '12/22/2005 20 Notice of Agenda of Matters Scheduled for Hea +ring (related document(s)2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, + 16, [17], 18, 19) Filed by Fubar, Inc.. Hearing scheduled for 4/11/2013 at 11:30 AM'; if($str=~m{related.+\)(.+?)\[(.+?)\](.+?)\)}){ print join "\n" => map{ split/,\s*/,$_}($1,$2,$3); }
Update: I think it is also a good practice to test what you match.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Comment on Re: regex capture and quantifiers
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-11-29 18:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (752 votes), past polls