Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
regex_verbose.py
_options_regex = re.compile(
r'''
(?P<keyword>[\w.-]+) # Consist of 1+ alphanumeric or '.' or '-'
\s*
(?P<settings> # Settings are optional
: # "Keyword/settings" delimiter
\s*
(?P<quote>"?) # Optional quote character
(?P<value>
(
(
(\\")
|
(\\;)
|
.
)+?
)
) # Value is a non greedy match
(?P=quote) # Matched quote character for the first one
)?
\s*
($|;) # Entry ends with ; or end of string
\s* # Spaces
''',
re.VERBOSE
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.