Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

An optimization of last resort: eliminate capturing from your regexps

by diotalevi (Canon)
on Jul 11, 2006 at 03:31 UTC ( [id://560296]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str = 'Hulk hate classless system with means of manufacturing given t
    +o working class! Hulk crush puny Marxists!';
    if ( $str =~ /Hulk hate (\w+)/ ) {
        $str = '';
        my $word = $1;
    }
    
  2. or download this
    if ( $str =~ /Hulk hate \w+/ ) {
        # $-[0] == 0
        # $+[0] == 19
    ...
    =cut
    
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://560296]
Approved by bobf
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found