[PATCH] lyxpreview_tools.py: fix a regular expression

Neven Sajko nsajko at gmail.com
Sat Feb 15 19:26:09 UTC 2020


Two notes: it would be better to use raw strings (r"string") and to maybe do
r"\(a|b|c|d)" instead of r"(\a|\b|\c|\d)" (use distributivity, in other words).

So, I think you want this:

def_re = re.compile(r"\(newcommandx|renewcommandx|global\long\def)(\[a-zA-Z]+)(.+)")

Regards,
Neven Sajko


More information about the lyx-devel mailing list