in reply to Replace zero-width grouping?
#!/usr/bin/perl -wl use strict; $_="17341234"; s/(.)(?=...\1)|(?<=(.)...)\2/defined $1 ? "A" : "B"/eg; print; __END__ A7AAB2BB [download]
Makeshifts last the longest.