axiak / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
295 stars 39 forks source link

Fix issue #5 #8

Closed itsadok closed 12 years ago

itsadok commented 12 years ago

Hi, Should have done this a long time ago, but I finally sat down to write the lines for handing \W, \S and \D.

Two issues:

  1. I still have the older version of re2, so I did my coding and testing on the previous version, and didn't commit the changes to the cpp file. If you could build and run the test on the new version it would be great.
  2. I couldn't figure out a good solution for [\W] and [\S], since they're made out of more than one character class, and De-Morgan's laws make it tricky to fix it in the general case. What I ended up doing is fall back to python re when I detect those char classes inside a char class definition.