Skip to main content

An implementation of the GNU interface to regex in Python

Reason this release was yanked:

bdist platform tag is incorrect

Project description

Pygnuregex, GNU regex for Python

Pygnuregex is a Python package for the GNU interface of regex functions in <regex.h>. The GNU interface provides a wide range of different syntaxes for the regex compiler. This package requires GNU libc to work properly; prefer the sdist if you're worried about ABI compatibility.

Example

import pygnuregex

# Search for the first match
p = pygnuregex.compile(b"f\\(oo\\)[0-9]+")
result = p.search(b"hello foo123!") # ==> 6
p.span() # ==> [(6, 12), (7, 9)]

# All matches
p = pygnuregex.compile(b"\\(foo\\|bar\\)[0-9]+")
list(p.finditer(b"hello foo123 and bar456!"))
# ==> [[(6, 12), (6, 9)],[(17, 23), (17, 20)]]

The SyntaxFlag enum contains all the available syntax options that may be set in pygnuregex.compile().

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

pygnuregex-1.1.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

pygnuregex-1.1.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pygnuregex-1.1.1.tar.gz.

File metadata

  • Download URL: pygnuregex-1.1.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pygnuregex-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e62425e7aeb7d8c3838e3fe0ba8591e73c0dc792ab84d0f413b6d2318c2cf8a3
MD5 af063f0642d41cafe19e674200836325
BLAKE2b-256 a682f6d5026813f86c88882e90094e3af16a068c868bfce099c23e7d913c9c2a

See more details on using hashes here.

File details

Details for the file pygnuregex-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pygnuregex-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for pygnuregex-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 007a0af7cfbada8d0a3d81a4e0dfc880ba4263dc553ae3c9a1e45f4d85aaacfe
MD5 ce4039a14ec5725f9a7d9d1cbfe95951
BLAKE2b-256 b7f25d1fa1d84bbd473fadb4843f5edec8634f08b2f77372152f5e8a5514f668

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