An implementation of the GNU interface to regex in Python
Reason this release was yanked:
crashed in Python 3.10 and earlier due to ctypes bug
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
Release history Release notifications | RSS feed
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.4.tar.gz
(18.6 kB
view details)
File details
Details for the file pygnuregex-1.1.4.tar.gz.
File metadata
- Download URL: pygnuregex-1.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b721826de7a8f04908415a418ebaf609b23c826eb1af47550e4c8f395b7d6d66
|
|
| MD5 |
3bb890dc828eb6b24155d4682d1bada0
|
|
| BLAKE2b-256 |
5b8ce57e4494c7314ffc5530a6a70629b4fbdcdfc42fd361daf4ad9efc4cb39a
|