Make the default value match for a variable non-greedy.

This avoids the problem where a closing brace in the description was
seen as terminator.
This commit is contained in:
Mark de Wever 2008-07-19 07:58:54 +00:00
parent 2283975313
commit 60bb964163

View file

@ -86,7 +86,7 @@ if __name__ == "__main__":
# x1 (f_unsigned = 0) The x coordinate of the startpoint.
# x1 (f_unsigned) The x coordinate of the startpoint.
variable = "(?:[a-z]|[A-Z])(?:[a-z]|[A-Z]|[0-9]|_)*"
regex = re.compile(" *(" + variable + ") \((" + variable + ") *(?:(?:= *(.*))|)\) +(.*)\n")
regex = re.compile(" *(" + variable + ") \((" + variable + ") *(?:(?:= *(.*?))|)\) +(.*)\n")
res = regex.findall(data)
# empty table