I want to extract 2 lists of words that are connected by the sign =
. The regex code works for separate lists but not in combination.
Example string: bla word1="word2" blabla abc="xyz" bla bla
One output shall contain the words directly left of =, i.e. word1, abc and the other output shall contain the words directly right of =, i.e. word2, xyz without quotes.
\w+(?==\"(?:(?!\").)*\")
extracts the words left of =, i.e. word1,abc
=\"(?:(?!\").)*\"
extracts the words right of = including quotes and =, i.e. ="word2",="xyz"
How can I combine these 2 queries to a single regex-expression that outputs 2 groups? Quotes and equal signs shall not be outputted.