Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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


Comment on Re: global regex
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://778254]
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: (5)
As of 2015-08-28 00:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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













    Results (334 votes), past polls