I have a string in golang – name=John :Doe1:age=20:height:6|age=25:height:5:name=John Do|e2|name=John Doe3:age=28:height:4
I want values of all names using regex.
name starts with name=
and ends with unescaped either :
or |
, if :
or |
are preceded by , then they are part of the name.
Output I want:
- John :Doe1
- John Do|e2
- John Doe3
The only way I know this could be done is through negative feedback, but it’s not supported by Go.