Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Regexp matching words, not doing what I expect

by cosmicperl (Chaplain)
on May 13, 2009 at 17:54 UTC ( [id://763851]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $text = "hello to all the perl monks";
    while ($text =~ /\b([A-Za-z'\-]+ [A-Za-z'\-]+)\b/g) {
        print "$1\n";
    }#while
    
  2. or download this
    hello to
    to all
    all the
    the perl
    perl monks
    
  3. or download this
    hello to
    all the
    perl monks
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://763851]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-06-16 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.