Brutkey

schuelermine
@anselmschueler@ieji.de

can you use PCRE2 regexes to replace repeated occurrences of characters that alternate between two character classes, e.g. [ab] and [xy], separated by some character, e.g. -, so a-x-b-x-a-y-b-y-b-x-a-x-a-y-a-x-b, with that same string with the separator removed?


schuelermine
@anselmschueler@ieji.de

(obviously you can repeatedly substitute pairs but I wanna do it in ONE pass)

R.L. Dane :Debian: :OpenBSD: :FreeBSD: 🍡🍡 :MiraLovesYou:
@rl_dane@polymaths.social

@anselmschueler@ieji.de

s/\([ab]\)-\([xy]\)/\1\2/g ?

That's just ordinary regex

schuelermine
@anselmschueler@ieji.de

@rl_dane@polymaths.social that won’t replace overlapping pairs

a-x-a-x β†’ ax-ax