I have a specific requirement to find a pattern and replace the value of matching group(2) in the original string by retaining the pattern(delimiter), I am using the pattern
:(\w+)[:\|]+(.*)
With this pattern it parse the values correctly but i am not able to replace the value of group(2). For example i have a multi-line input string
:20:9405601140
:2D::11298666
:28C:20/1
I want to replace the value(9405601140) of tag 20 with new value(1234) so the output i am expecting is
:20:1234
:2D::11298666
:28C:20/1
Thanks