in reply to Re^2: substrings that consist of repeating characters
in thread substrings that consist of repeating characters
Does that work?
Win8 Strawberry 5.30.3.1 (64) Tue 09/29/2020 13:32:10 C:\@Work\Perl\monks >perl use strict; use warnings; my $string = 'AABBBBCCC'; my $len = 0; my $best = ""; while ($string =~ /((.)(?:(*SKIP)\2){$len,})/g) { $len = length $1; $best = $1 } print "best: '$best' \n" ^Z best: ''
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: substrings that consist of repeating characters
by salva (Canon) on Sep 29, 2020 at 20:59 UTC | |
by choroba (Cardinal) on Sep 29, 2020 at 21:20 UTC | |
by salva (Canon) on Sep 30, 2020 at 07:32 UTC |