I have String (inside i have escaping of equal sing =) :
attr1=ActiveList attr2=<Resource URI="/All Active Lists/_CAL/Infrastructure/Active Directory/Inventory/Inventory - By User (Dedd)" ID="DSdddCcSSS=="/> attr3=ActiveLis attr4=ActiveList attr5=<Resource URI="/All Active Lists/_CAL/Infrastructure/Active Directory/Inventory/Inventory - By User (Bobo)" ID="CCCsSSdDDD=="/> attr6=ActiveLis
P.S. Sometimes might be:
key=value = otherthink
How do i covert it to key=value pairs with regex:
attr1=ActiveList
attr2=<Resource URI="/All Active Lists/_CAL/Infrastructure/Active Directory/Inventory/Inventory - By User (Dedd)" ID="DSdddCcSSS=="/>
attr3=ActiveLis
attr4=ActiveList
attr5=<Resource URI="/All Active Lists/_CAL/Infrastructure/Active Directory/Inventory/Inventory - By User (Bobo)" ID="CCCsSSdDDD=="/>
attr6=ActiveLis
key=value = otherthink
I'v tried few patterns eg.
s?(w+)s?=s?(.(?!=(?<!\=))(?!w+=))+
The target language(s): Java & Python. i prefer pure RegEx
Without success. :-
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…