No project description provided
Project description
regexrs
Leverages the Rust regex crate with PyO3 to create an interface similar to the Python
standard library re module.
>>> import regexrs as re
>>> pattern = re.compile(r'(\w+) (\w+)')
>>> m = pattern.match('hello rust')
>>> m.groups()
('hello', 'rust')
>>> m.pos
0
>>> m.endpos
10
How to install from source
You can use pip to build and install.
pip install .
If you want to build manually:
pip install maturin
maturin build --release
Status
Mostly incomplete and likely very buggy. I am using this mostly as an exercise in creating and distributing Python extensions using Rust and PyO3. It's unclear if this will ever be a particularly useful project or not. If you're looking for a complete and performant regex library for Python today, see the regex project on PyPI.
Differences compared to standard lib:
- The
endposargument normally found in theremodule is not supported inregexrsfor thematch/search/findall/finditermethods. - Some regex features are not supported (because they are not supported by the
regexcrate), such as lookarounds and backreferences. - Until a future release, flags are expected to be part of your pattern. For example, instead of passing
re.Ifor case-insensitive patterns or other flags, you would write these flags inline like(?i)at the beginning of your pattern. - Until a future release, there is no cache for avoiding re-compiling the same patterns multiple times
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file regex_rust-0.1.0rc1-cp312-none-win_amd64.whl.
File metadata
- Download URL: regex_rust-0.1.0rc1-cp312-none-win_amd64.whl
- Upload date:
- Size: 701.7 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a99dd2fa6c6653f0e5aec5ea31727075f65ef74d7027686807784b0c1d7334e4
|
|
| MD5 |
57ee27541f833b048ec4d445f6e1d866
|
|
| BLAKE2b-256 |
a2aa6b4052da6afa8116ffe33403a77e65bc0be30d16bd5d6b03cebb856f4f3f
|