Skip to main content

python regular expressions for humans

Project description

re_patterns

python regular expressions for humans

Description

This module helps you build complex regular expressions.

Usage

Example:

>>> from re_patterns import Rstr

>>> regex = Rstr("Isaac").not_followed_by("Newton").named("non_newtonians")
>>> regex
'(?P<non-newtonians>Isaac(?!Newton))'
>>> match = regex.search("Isaac Lobkowicz, Isaac Newton")
>>> match.span()
(0, 5)
>>> match.group("non_newtonians")
'Isaac'

For further uses please look at the methods of the Rstr class in __init__.py.

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

re_patterns-1.1.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

re_patterns-1.1.0-py3-none-any.whl (5.2 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