in reply to Regex: finding all possible substrings

What have you tried? What didn't work? We are not a code writing service.

If you need to generate permutations, you can do that pretty easily with glob. That combines with regular expressions pretty easily - have you read perlretut? Also, for your example, I can't get your count of 5 for AAA -- I see either 4 or 6 depending on how you count overlaps.

Update: Stupid failing eyes. I counted two AAAs in the third word.

Node text goes above. Div tags should contain sig only

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Regex: finding all possible substrings
by sauoq (Abbot) on May 31, 2012 at 23:05 UTC
    I can't get your count of 5 for AAA

    Assuming his spaces are significant, there are 5.

    But there are 3 "ACA"s. And that's what he said. My bad.

    -sauoq
    "My two cents aren't worth a dime.";