GithubHelp home page GithubHelp logo

hartl3y94 / pyre2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/pyre2

0.0 0.0 0.0 49 KB

Python wrapper for RE2

License: BSD 3-Clause "New" or "Revised" License

C++ 73.78% Makefile 0.50% Python 25.72%

pyre2's Introduction

pyre2

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 <[email protected]>.

License

See the LICENSE file for more information.

pyre2's People

Contributors

adamhooper avatar bos avatar dreiss avatar fim avatar flarnie avatar jamesgpearce avatar jwilk avatar moreati avatar noxiouz avatar rla3rd avatar spamaps avatar sunshowers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.