I'm trying to write a regexp to use in a parser. Specifically, I'd like to be able to parse strings formatted like so:
[SOME-WORD "Quoted string"]
Currently, I'm trying the following expression:
(?P<capital-item>
\[SOME-WORD(\ ?)\"
(?P<quoted-string>\w+)
\"(\ ?)\])
I'm using python, and re.compile to get a scanner. Once compiled, the regexp doesn't match the example string I gave above. What am I messing up here?
\wdoes not match the space between "Quoted" and "string".\wis equivalent to[a-zA-Z0-9_](no space).capital-itemnorquoted-stringare.