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
In reply to Re^2: Regex help needed
by AnomalousMonk
in thread Regex help needed
by ghosh123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |