in reply to Can't remove ANSI markup
Hi, there should be a better way, maybe colorstrip() from Term::ANSIColor ?
Or, perhaps this will help:
( note: barely tested and likely to be fragile)$ perl -Mstrict -wE 'my $str = q{[\033[96m]word[\033[0m]}; say $str; s +ay $str =~ s/ \[ \\? \d+ [a-zA-Z]? \]? //gxr' [\033[96m]word[\033[0m] word
|
|---|