Skip to main content

Linter for (Pygments) regular expressions

Project description

Regexlint will examine all regular expressions in an importable Pygments lexer, and report things that are probably not doing what you think they’re doing. For example, patterns like:


It can also warn about a few syntax problems, for example this has two problems – the s+ outside the groups, and not enough actions in bygroups:

(r'(foo)\s+(bar)', bygroups(Blah)),


make demo
python2 pygments.lexers.web
python2 pygments.lexers.web:HtmlLexer


  • Figure out which phase should remove unnecessary backslashes

  • Write the alternation expander, so that ([ax]|a[bc]) fails the alternation order checks

  • Make more general than just for Pygments


This project is licensed under the Apache Public License, see COPYING

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regexlint-0.9.tar.gz (18.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page