in reply to Pattern matching forwards/backwards???
#!/usr/bin/perl use strict; my $string = "KLEWREGREG-----REGREGEWD....-EWGREGERABCSHRT..----...XFG +HWW....----....TRYU"; my @array = split ("[.-]+",$string); my $interested = $array[$#array-1]; print $1 if ( $interested =~ m/([a-zA-Z]{3}$)/); Output : HWW
|
|---|