I want a regex that can match either one group, or two groups. Here is an example of how it looks. Either like this:
(key)
Or like this:
(key “value”)
So far I’ve come up with an expression which matches the latter example. But I have no idea how to modify it so it matches either the first one, or the latter one. Here it is:
\((?P<property_key>[^() ]+) "(?P<property_value>[^"]*)"\)
I believe you are looking for regex pattern