Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/facebook/pyre2
Python wrapper for RE2
https://github.com/facebook/pyre2
Last synced: about 1 month ago
JSON representation
Python wrapper for RE2
- Host: GitHub
- URL: https://github.com/facebook/pyre2
- Owner: facebook
- License: bsd-3-clause
- Created: 2010-03-16T18:45:15.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T17:01:23.000Z (about 1 year ago)
- Last Synced: 2024-09-29T11:25:31.218Z (about 2 months ago)
- Language: C++
- Homepage:
- Size: 47.9 KB
- Stars: 636
- Watchers: 49
- Forks: 174
- Open Issues: 7
-
Metadata Files:
- Readme: README
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
=====
pyre2
=====.. contents::
Summary
=======pyre2 is a Python extension that wraps
`Google's RE2 regular expression library
`_.
It implements many of the features of Python's built-in
``re`` module with compatible interfaces.New Features
============* ``Regexp`` objects have a ``fullmatch`` method that works like ``match``,
but anchors the match at both the start and the end.
* ``Regexp`` objects have
``test_search``, ``test_match``, and ``test_fullmatch``
methods that work like ``search``, ``match``, and ``fullmatch``,
but only return ``True`` or ``False`` to indicate
whether the match was successful.
These methods should be faster than the full versions,
especially for patterns with capturing groups.Missing Features
================* No substitution methods.
* No flags.
* No ``split``, ``findall``, or ``finditer``.
* No top-level convenience functions like ``search`` and ``match``.
(Just use compile.)
* No compile cache.
(If you care enough about performance to use RE2,
you probably care enough to cache your own patterns.)
* No ``lastindex`` or ``lastgroup`` on ``Match`` objects.Current Status
==============pyre2 has only received basic testing,
and I am by no means a Python extension expert,
so it is quite possible that it contains bugs.
I'd guess the most likely are reference leaks in error cases.RE2 doesn't build with fPIC, so I had to build it with
::
make CFLAGS='-fPIC -c -Wall -Wno-sign-compare -O3 -g -I.'
I also had to add it to my compiler search path when building the module
with a command like::
env CPPFLAGS='-I/path/to/re2' LDFLAGS='-L/path/to/re2/obj' ./setup.py build
Contact
=======You can file bug reports on GitHub, or email the author:
David Reiss .License
=======See the ``_ file for more information.