Matching C integer constants with re
Skip Montanaro
skip at pobox.com
Thu Jun 12 12:27:44 EDT 2003
Thomas> re.compile(r"(0[xX][0-9a-fA-F]+|\d+)([uU]|[lL]|[uU][lL]|[lL][uU])?")
Thomas> and it fails to match constants with a two character suffix like
Thomas> these: "123ul" and "123lu", although "123u" and "123l" are found
Thomas> correctly. Can anyone see what's wrong?
Try reordering the "ul" stuff so the two-character options occur earlier:
...([uU][lL]|[lL][uU]|[uU]|[lL])?
Skip
More information about the Python-list
mailing list