Skip to main content

Simple regex library

Project description

pyregex(p)

What is it

Pyregex(p) is a backtracking Regex Engine complete with all major regular-expressions' features.

It is composed of a Lexer, a Parser (a TDRD parser) and finally the Engine.

Features implemented includes:

Feature Syntax
match start ^...
match end ...$
escaping \
grouping (...)
named group (?<name>...)
non-capturing group (?:...)
alternative a|b
wildcard .
space \s
quantifiers ? * +
curly brace quantification {exact} {min,max} {,max} {min,}
range element [^a-zA-Z059]

Play with the engine:

from pyregexp.engine import RegexEngine

reng = RegexEngine()

reng.match('^my_(beautiful_)+regex', '^my_beautiful_beautiful_beautiful_regex')

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

pyregexp-0.3.1.tar.gz (18.0 kB view hashes)

Uploaded Source

Built Distribution

pyregexp-0.3.1-py3-none-any.whl (14.4 kB view hashes)

Uploaded Python 3

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