Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 making s'mores by the fire in the courtyard of the Monastery: (15)
As of 2014-07-25 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls