Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Elegant (i.e. declarative) way to find all possibly overlapping matches

by Not_a_Number (Prior)
on Sep 18, 2003 at 18:41 UTC ( #292485=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $str = 'braaaafdhjklghaa';
    my $sstr = 'aa';
    my $len = length $sstr;
    for ( 0 .. ( length $str ) - $len ) {
       print "Found at $_\n" if substr ($str, $_, $len) eq $sstr;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2020-01-21 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?