use strict; use warnings; use Term::ANSIColor; my $t = "ACGCGATAGCATTAGACCTGGCACAGT"; $t =~ s/([CG]AT)/colored($1,'bold red')/ge; print $t, "\n";