lamuguo / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

not string format data like having null character can not match. #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.try to match not string data with re2.
example) binary data \00\01\02\03 with pattern \x00\x01

What is the expected output? What do you see instead?
1.Re2 is not supporting to match not string data that I know.
2.Is it possiable data including null characher match to pattern like '\x00'?
3.If not, Do you have any plan to support in the future?

What version of the product are you using? On what operating system?

Please provide any additional information below.
NOTE: If you have a suggested patch, please see
http://code.google.com/p/re2/wiki/Contribute
for information about sending it in for review.  Thanks.

Original issue reported on code.google.com by kino...@gmail.com on 18 Jan 2012 at 1:18

GoogleCodeExporter commented 9 years ago
I believe you are trying to use a string constant like "\x00\x01\x02\x03". That 
will not work because it shows up in C++ as a C string constant, and C strings 
are measured with strlen, which stops at the \x00. Instead, you can write 
something like re2::StringPiece("\x00\x01\x02\x03", 4), and I think that will 
work.

Original comment by rsc@swtch.com on 14 Jul 2012 at 2:35