Skip to content

Commit 1094ef3

Browse files
committed
Merge branch 'master' of https://github.com/itsadok/pyre2 into itsadok-master
2 parents c4aa5b7 + 432effa commit 1094ef3

9 files changed

+3862
-2370
lines changed

README.rst

+12
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ And in the above example, ``set_fallback_notification`` can handle 3 values:
4747
``re.FALLBACK_QUIETLY`` (default), ``re.FALLBACK_WARNING`` (raises a warning), and
4848
``re.FALLBACK_EXCEPTION`` (which raises an exception).
4949

50+
**Note**: The re2 module treats byte strings as UTF-8. This is fully backwards compatible with 7-bit ascii.
51+
However, bytes containing values larger than 0x7f are going to be treated very differently in re2 than in re.
52+
The RE library quietly ignores invalid utf8 in input strings, and throws an exception on invalid utf8 in patterns.
53+
For example:
54+
55+
>>> re.findall(r'.', '\x80\x81\x82')
56+
['\x80', '\x81', '\x82']
57+
>>> re2.findall(r'.', '\x80\x81\x82')
58+
[]
59+
60+
If you require the use of regular expressions over an arbitrary stream of bytes, then this library might not be for you.
61+
5062
Installation
5163
============
5264

src/_re2.pxd

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
cdef extern from *:
32
ctypedef char* const_char_ptr "const char*"
43

@@ -11,7 +10,7 @@ cdef extern from "<string>" namespace "std":
1110
void push_back(char c)
1211

1312
ctypedef string cpp_string "std::string"
14-
ctypedef string const_string "std::string"
13+
ctypedef string const_string "const std::string"
1514

1615

1716

0 commit comments

Comments
 (0)