Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Anonymous Monk
on Aug 06, 2000 at 09:16 UTC ( #26408=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 Anonymous Monk

Hi guys. This seems to work. I'd like some comments on this. I'm trying to further my perl education. Thanks. -Ty
$line = "start this is the start this is another end first end start h +ello start inside of hello end there end"; while ($line=~ s/\s*\bstart\b(?!.*?\bstart\b) (.+?) \bend\b//) { print $1, "\n"; }
tkroll@hawaii.edu

  • 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?
[choroba]: Also, I'd try starting the App with the US layout and switch to the dead keys layout later
[Tux]: no, it was not .xinput related, but that did ring a bell. digging in my $ENV I found the cause: XMODIFIERS=@im=xim
[Tux]: Héŀłő çřűèļ ŵøŗľđ, ıŧ'š ºvəř
[choroba]: ÿǎÿ!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-09-25 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (290 votes). Check out past polls.

    Notices?