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

Re^3: Regexes: finding ALL matches (including overlap)

by blokhead (Monsignor)
on Jun 04, 2005 at 12:21 UTC ( #463519=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub match_all_ways {
        my ($string, $regex) = @_;
    ...
    
    print match_all_ways("abcdef", qr/..*..*./); # 20
    print match_all_ways("abcdef", qr/..*..*./); # undef
    
  2. or download this
    sub match_all_ways {
        use vars '$count';
    ...
        $string =~ /(?:$regex)$incr(?!)/;
        return $count;
    }
    
  3. or download this
    {
      my $count;
    ...
          return $count;
      }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2014-04-19 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls