#!/usr/bin/perl use strict; use warnings; my $txt = "06:00\x1b[1;1H \x1b[24;0H \x1b[K 7 \x1b[1;1H " . "\x1b[0;7m list tvbs dnv 3334 06:00 \x1b[0m 8"; # Remove strings like [ $txt =~ s/\x1b\[[0-9;]+[A-Za-z]//g; print $txt;