Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Just another Perl shrine
 
PerlMonks  

Re: How to capture all occurances from a slurped file.

by shmem (Chancellor)
on Aug 24, 2006 at 18:04 UTC ( [id://569465]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How to capture all occurances from a slurped file.

You're just missing the loop:
while ($data =~ m{(\d+-)(\d+-)(\d+)(\s*/\s*)(\d+)(\s*/\s*)(\d+)}g) { print "$1, $2, $3, $4, $5, $6, $7\n"; }

After each match is found, the search continues where the last match left. So you get all occurrences.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: How to capture all occurances from a slurped file.
by Grey Fox (Chaplain) on Aug 24, 2006 at 19:21 UTC
    Thanks;
    I knew I was close. I just could not put my finger on what to use for the loop.
    -- Grey Fox
    Perl - Hours to learn lifetime to master.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://569465]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.