in reply to Re^2: Replace part of a regex match
in thread Replace part of a regex match
A regex something like the following might be better (although it is still a bit awkward):
>perl -wMstrict -le "my $u = 'http://foo.bar.de/?baz|2.0|323|91793|1|277|fee=_fie'; print $u; $u =~ s{ \A ((?: [^|]* \|){5}) \d+ (\|.*) \z }{${1}976$2}xms; print $u; " http://foo.bar.de/?baz|2.0|323|91793|1|277|fee=_fie http://foo.bar.de/?baz|2.0|323|91793|1|976|fee=_fie
|
---|