in reply to Find Number in String then Ignore Characters proceeding

A little more legible (if not as elegant) version of what the previous post is doing:
#! perl my $str = '.,a..A,,C..+4ACGTG.,-2TG,,...,a.'; print replace($str); sub replace { my $str = shift; if ($str =~ m/([+-])(\d*)/) { $str =~ s/\Q$1\E$2.{$2}//; return replace($str); } return $str; }

Strange things are afoot at the Circle-K.