Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Regular expression...

by prasadbabu (Prior)
on Oct 08, 2010 at 06:27 UTC ( #864153=note: print w/ replies, xml ) Need Help??


in reply to Regular expression...

Here is one way to do it.

$string =' some another lines =begin some lines some lines =end some another lines...'; while ($string =~ /(?:(?:^|\n)=begin)((?:(?!\n=end).)*)\n=end/gs){ print "$1\n"; } output: ======= some lines some lines
Updated: included '\n' before =end.

Prasad


Comment on Re: Regular expression...
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-06 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls