Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regex capture and quantifiers

by Laurent_R (Canon)
on Apr 30, 2013 at 21:17 UTC ( [id://1031477]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<5> $c = "The quick brown fox jumps over the lazy dog.";
    
      DB<6> print $1 if $c =~ /.+ (\w+) /;
    lazy
      DB<7>
    
  2. or download this
      DB<8> print $1 if $c =~ /[^ ]+ (\w+) /;
    quick
    ...
      DB<11> print $1 if $c =~ /.+? (\w+) /;
    quick
      DB<21>
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-18 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found