Skip to main content

No project description provided

Project description

# Regular expressions made readable

## Introduction

bourbaki.regex provides an interface for constructing arbitrarily complex regular expressions using standard Python syntax.

The goals of the package are the following:

  • allow the user to be as terse as possible while not sacrificing readability

  • support the full range of constructs available in the standard library regex engine (re module)

  • be extensible and modular to support more advanced constructs in the future, as for instance provided by the regex module

  • handle minutiae such as handling backreferences (inferring the correct group index)

  • raise meaningful errors at compile time, such as named group collisions, nonexistent backreferences, and lookbehind assertions that are not fixed-length.

## Usage

There are a few base constructors from which all expression patterns can be built:

  • bourbaki.regex.C: Character class constructor. C[‘a’:’z’, ‘A-Z’, ‘0’:’9’] for instance is equivalent to the raw regular expression r’[a-zA-Z0-9]

  • bourbaki.regex.L/Literal: Literal string match. This handles escaping special characters that are reserved for regular expression syntax. For example L(‘*foo[bar]*’) is equivalent to the raw regular expression r’*foo[bar]*’ (note the ‘' escapes)

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

bourbaki.regex-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bourbaki.regex-0.1.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file bourbaki.regex-0.1.0.tar.gz.

File metadata

  • Download URL: bourbaki.regex-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for bourbaki.regex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 246c443a2ca014e6d2dda0b86fa56083d1f1b90c839799380436330860bd20be
MD5 501d2f668dff65c1744d106e433c5596
BLAKE2b-256 4b24d79c02d92a60920d1f64f1c55cfdb75273f0146178fdf88918c53a6e1419

See more details on using hashes here.

File details

Details for the file bourbaki.regex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bourbaki.regex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for bourbaki.regex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a1387596591b53ca8ac275ca95e627558d7a28ad9f20a5abe72355cf553e7c8
MD5 b9e1d3463c3272a3bcad600fefce81dd
BLAKE2b-256 3ed6a308e30b0d7d7ea09ee004d635ee130e4e50097e199248ba610f6c94fc7c

See more details on using hashes here.

Supported by

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