This is a very simple problem to which there appears to be more than one answer, potentially. I am looking for the longest substring composed of a single repeating character. I can find all substrings having a repeated character longer than size "n" using a regex like:
my $re = '(.)\1' . "{$n,})"but I can't seem to figure out how to find the longest stretch. My brute-force solution would be to loop over reasonable values of "n" and check them all. This is probably adequate for my needs where 1<n<20 or so. I'm just curious what other solutions folks might have, given that I am looking for repeats of a single character.
Thanks,In reply to Longest possible run of a single character by srdst13
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |