Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 rifling through the Monastery: (13)
As of 2015-08-03 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (45 votes), past polls