in reply to Re: Regex help needed
in thread Regex help needed

Unfortunately, that solution has a problem similar to that in the OPed code:

>perl -wMstrict -le "for my $data (qw( Smith%John%BC142%Alberta Johnson%Andrew%AX321%Engineer )) { if($data =~ /.*%.*%A/) { my @arr = split('%', $data); print qq{$arr[0] $arr[1]}; } } " Smith John Johnson Andrew