Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: How do I extract all text between two keywords like start and end?

by Punto (Scribe)
on May 17, 2000 at 16:28 UTC ( #12070=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I extract all text between two keywords like start and end? - Answer contributed by Punto

($content) = $string =~ m/ start (.*) end /;
That will get the stuff between " start " and " end " into $content.

  • Comment on Answer: How do I extract all text between two keywords like start and end?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-09-23 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (273 votes). Check out past polls.

    Notices?