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 name 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
Only way I know this could be done is negative lookbehind, but its not supported by go.