Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: non-greedy piecewise matching

by NetWallah (Canon)
on Aug 02, 2007 at 16:56 UTC ( #630331=note: print w/replies, xml ) Need Help??


in reply to non-greedy piecewise matching

The non-greedy version of "+" is "+?". (perlreref).

     "An undefined problem has an infinite number of solutions." - Robert A. Humphrey         "If you're not part of the solution, you're part of the precipitate." - Henry J. Tillman

Replies are listed 'Best First'.
Re^2: non-greedy piecewise matching
by mifflin (Curate) on Aug 02, 2007 at 17:24 UTC
    thanks, that worked...
    > cat x my $data = 'jlasflsf.xmljlasjlkjlasjflsdf.xmlklajlajlsdfjkl.xml'; while (pos $data < length $data) { if ( $data =~ m{ \G ( .+? \. xml) }gcxms ) { print "$1\n"; } } > perl x jlasflsf.xml jlasjlkjlasjflsdf.xml klajlajlsdfjkl.xml

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2023-03-20 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (59 votes). Check out past polls.

    Notices?