Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: matchin a string inside of another string

by nmcfarl (Pilgrim)
on Apr 05, 2004 at 04:32 UTC ( #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? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2023-01-28 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?