You'll have to benchmark to see if this is more efficient:
my %uniq; my $s = "ABCABCABC1231234123123ABCABCABC123TestTestTestTestTest1234123 +123123121212121212121212121ppppp";; print for grep{ ++$uniq{$_} == 1 } $s =~ m[(?=(.+)\1{4})]g;; Test 1212 2121 12 21 p
In reply to Re: Capture variable length pattern when it repeats variable times
by BrowserUk
in thread Capture variable length pattern when it repeats variable times
by exilepanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |