Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: extract all string between two words

by EvanCarroll (Chaplain)
on Nov 13, 2009 at 16:54 UTC ( #807001=note: print w/ replies, xml ) Need Help??


in reply to extract all the text between two words

Your anchors (^) are messed up, they mean the beginning of the string when on the left-most position. Also, you need to do the actual splitting, after you do the extraction.

# If you just want the stuff in between $transcript =~ /CORPORATE PARTICIPANTS(.*)CONFERENCE CALL PARTICIPANTS +/i; $1; # $transcript =~ /CORPORATE PARTICIPANTS foo bar baz CONFERENCE CALL P +ARTICIPANTS/i; # If you want foo, bar, baz my @words = split /\W/, $1; say for @words;


Evan Carroll
The most respected person in the whole perl community.
www.evancarroll.com


Comment on Re: extract all string between two words
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (18)
As of 2015-07-01 19:45 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 (17 votes), past polls