Try with the expression:
/\|([^=|]+)=([^|]*)/g
or if you just want the pattern:
\|([^=|]+)=([^|]*)
Depending on your environment you will be able to get captures of group 1 and 2 for each key-value pair.
(I'm not able to test it out right now.)
Update 1: I did a short test and adapted it with the optimization of Wiktor Stribizew.
Update 2: Short explanation of the regex used:
The \b
in your pattern means word boundary and does not represend a sign. You cannot combine it with +
. See also What is a word boudary.
The first group ([^=|]+)
matches anything that is not a =
or a |
with at least one character.
The second group ([^|]*)
matches anything that is not a =
with zero or more characters (addition information
has an empty value).