I have this expression
:([^"]*) \(([^"]*)\)
and this text
:chkpf_uid ("{4astr-hn389-918ks}")
:"#cert" ("false")
Im trying to match it so that on the first sentence ill get these groups:
- chkpf_uid
- {4astr-hn389-918ks}
and on the second, ill get these:
#cert- false
I want to avoid getting the quotes.
I can't seem to understand why the expression I use won't match these, especially if I switch the [^"]* to a (.*).
with ([^"]*): wont match
with (.*): does match, but with quotes
This is using the re module in python 2.7
:"?([^"]*)"? \("?([^"]*)"?\):"?([^"]*)"? \("{?(.*?)}?"\)[^"]*matches everything except". So either it matches the whole text or it reaches a position where there's a", you then ask the regex to match a space , which always fails because either there is nothing left or there is a".