Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: matchin a string inside of another string

by nmcfarl (Pilgrim)
on Apr 05, 2004 at 04:32 UTC ( [id://342571]=note: print w/replies, xml ) Need Help??


in reply to matchin a string inside of another string

I may be missing the point here but would something like this work?
$content= "bla foo bar letters stuff qwerty"; if ($content =~ /bla (.*?)qwerty/){ print "matched!\n"; @stuff = split /\s+/, $1; print "The stuff ".join(" ", @stuff)."\n" if @stuff; }
Basically I'm getting all the stuff between the tokens, and splitting that on whitespace, to produce the @stuff array.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found