in reply to
Replace part of a regex match
It seems to me that you want to replace the penultimate group that's separated with vertical bars with something else. In that case, I'd use
s/\|[^|]*\|([^|]*)$/|976|$1/;
[download]
Comment on
Re: Replace part of a regex match
Download
Code
In Section
Seekers of Perl Wisdom