Skip to main content

An implementation of the GNU interface to regex in Python

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.5.tar.gz (18.8 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.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (21.6 kB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

File details

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

File metadata

  • Download URL: pygnuregex-1.1.5.tar.gz
  • Upload date:
  • Size: 18.8 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.5.tar.gz
Algorithm Hash digest
SHA256 2703c6e740d5af3faf6b3f2a9988d7079f4ccce3c52aca3252d8675158d0acd4
MD5 97717fc74d3ddb0d7107c2b663ebd33b
BLAKE2b-256 74c8952c5dea8168705b8e73a2d17aaa9d7b2bb1979b6af7f5463fde82ab3681

See more details on using hashes here.

File details

Details for the file pygnuregex-1.1.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygnuregex-1.1.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6e0d15f6776da521e35ad4871eba96e75a0c176473135d558ea016d2e127e843
MD5 ac2c1face35cd09083be6433048b0b7a
BLAKE2b-256 fe51967360e10ec51497b754bcd10259c986fb5519a848f7fb96bf5a7c647c85

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