sqlparse
sqlparse copied to clipboard
Wrong Integer, Float tokenize
(r'(?![_A-ZÀ-Ü])-?(\d+(\.\d*)|\.\d+)(?![_A-ZÀ-Ü])', tokens.Number.Float)
(r'(?![_A-ZÀ-Ü])-?\d+(?![_A-ZÀ-Ü])', tokens.Number.Integer)
Why do we have here negative lookahead at the beginning? Shouldn't it look behind?! I would suggest replacing (?![_A-ZÀ-Ü]) with (?<![_A-ZÀ-Ü])
There is no point for lookahead here since the expression following (?![_A-ZÀ-Ü]) is definitely not in [_A-ZÀ-Ü]