This slightly modifies what you already had:
print "$2 $1\n" if /^([^%]+)%([^%]+)%A/;
Hope this helps!
Update: Just now noticed that this is similar to a solution posted by davido. Will remember to have coffee *first*, read all, and then post...
In reply to Re: Regex help needed
by Kenosis
in thread Regex help needed
by ghosh123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |