Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: pick a word contaning reg-ex

by Wiggins (Hermit)
on Dec 04, 2012 at 17:16 UTC ( #1007124=note: print w/ replies, xml ) Need Help??

in reply to pick a word contaning reg-ex

The problem says "Words containing an exclamation mark". This is not the same as "ending with".

This is flawed because it matches "!".
I don't know how to specify at least 1 sub-part must have a length > 0.

It is always better to have seen your target for yourself, rather than depend upon someone else's description.

Comment on Re: pick a word contaning reg-ex
Download Code
Replies are listed 'Best First'.
Re^2: pick a word contaning reg-ex
by Lotus1 (Chaplain) on Dec 04, 2012 at 19:54 UTC
    #!/perl use warnings; use strict; while(<DATA>){ print map {"$_\n"} grep{/!/ and /[^!]/} split; } __DATA__ Mary had a little lamb! , whose fleece! was white! as snow. And everywhere! that Mary went, the lamb was sure! to go. oops!eedaisy ! ! !! HI!!IH

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2015-10-09 18:18 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (248 votes), past polls