Removing anonymous groups and using raw-literal: regex(`^\s*(\w+)\s*=\s*"(.*)"\s*$`)Looks simpler I guess.
Good advice, thanks.
Though if key="value" is expected I'd suggest to use lazy .* - `"(.*?)"` to stop on first " if any.
After playing a bit with it, I realized that it doesn't work in this case (a="a"a" still match). The right solution would be "(.[^"])"