Skip to main content

Regexlint

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 this (which will only match the first):

(else|elseif)

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 (this one needs two in the args to bygroups):

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

Usage

make demo
    or
regexlint pygments.lexers.web:HtmlLexer
    or
python2 regexlint/cmdline.py pygments.lexers.web

Todo

  • 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

License

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

Metadata

Release files for regexlint 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for regexlint 0.9.2
File Size Uploaded Provenance Actions
regexlint-0.9.2.tar.gz 18.7 kB Without provenance Details for regexlint-0.9.2.tar.gz

Release files / regexlint-0.9.2.tar.gz

Download URL regexlint-0.9.2.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f9b36cdfbe8486a7599745722c1ca2d8a6644e2b9cbcb83505f97b8de9bcfe7c
BLAKE2b-256 checksum
How to use checksums
8fd92f86d833de1f6cfbceaa3d8a5561e58ba721b9364990734ea6b0ce405e41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for regexlint 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page