$u =~ s/(.*\|{5}).*(\|.*)/${1}976$2/; [download]
In reply to Re^2: Replace part of a regex match by Bloodnok in thread Replace part of a regex match by krisravn