in reply to Breaking symmetry with a regex

Your string as described ends with a colon. All you need is chop - no need for regex:

use strict; use warnings; use Test::More tests => 1; my $have = 'a:b:'; my $want = 'a:b'; chop $have; is $have, $want;

🦛