Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: non-greedy piecewise matching

by prasadbabu (Prior)
on Aug 02, 2007 at 17:03 UTC ( [id://630337]=note: print w/replies, xml ) Need Help??


in reply to non-greedy piecewise matching

Hi mifflin,

You have to use '.+?' instead of '.+' to make non-greediness. Take a look at perlre.

As you said, if .xml is present after each records, then we can also use substitution or split function.

$file =~ s/(\.xml)/$1\n/g;

Prasad

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2026-02-07 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    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.