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

Re: pick a word contaning reg-ex

by Kenosis (Priest)
on Dec 04, 2012 at 16:19 UTC ( #1007113=note: print w/ replies, xml ) Need Help??


in reply to pick a word contaning reg-ex

And another option:

use Modern::Perl; while (<DATA>) { say $1 while /(\S+!)/g; } __DATA__ Mary had a little lamb! , whose fleece! was white! as snow. And everywhere! that Mary went, the lamb was sure! to go.

Output:

lamb! fleece! white! everywhere! sure!


Comment on Re: pick a word contaning reg-ex
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2014-12-18 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (47 votes), past polls