Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: global regex

by si_lence (Deacon)
on Jul 08, 2009 at 13:12 UTC ( #778254=note: print w/replies, xml ) Need Help??


in reply to global regex

your code matches the first 'word' and prints it, then goes to the next line. One way of matching all words on a line is
while(<DATA>) { while ( /(\w+)/g ) { print "$1 "; } }
cheers

si_lence

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://778254]
help
Chatterbox?
[Lady_Aleena]: Discipulus, Hello there. How are you?
[Lady_Aleena]: Good GUH Discipulus! Do you have enough links there?
[Discipulus]: here quite well thanks. still alive. Unfortunately I have the 64Kb limit
Discipulus now is read a book to my daugther time. Just after she and mother stop yelling in the bathroom
[Lady_Aleena]: See you later, Discipulus. Have fun reading to your daughter.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2017-09-24 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?