Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Re: Re: New regex trick...

by japhy (Canon)
on Jul 22, 2002 at 20:49 UTC ( [id://184233]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str = "Match 9 the 1 last 6 digit 2 blah";
    $str =~ /.*\d/;    print "[$`] [$&] [$']\n";
    $str =~ /.*\K\d/;  print "[$`] [$&] [$']\n";
    __END__
    [] [Match 9 the 1 last 6 digit 2] [ blah]
    [Match 9 the 1 last 6 digit ] [2] [ blah]
    
  2. or download this
    # you go from this:
    s/(saveme)deleteme/$1/;
    
    # to this:
    s/saveme\Kdeleteme//;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found