RE2::Set::Match: match but unknown regexp set ?

119 views
Skip to first unread message

Igor Polevoy

unread,
Nov 19, 2012, 4:52:26 AM11/19/12
to re2...@googlegroups.com
Hi,
I'm trying to match the following regex
\b((((([0-1]?\d)|(2[0-8]))\/((0?\d)|(1[0-2])))|(29\/((0?[1,3-9])|(1[0-2])))|(30\/((0?[1,3-9])|(1[0-2])))|(31\/((0?[13578])|(1[0-2]))))\/((19\d{2})|([2-9]\d{3}))|(29\/0?2\/(((([2468][048])|([3579][26]))00)|(((19)|([2-9]\d))(([2468]0)|([02468][48])|([13579][26]))))))\s(([01]?\d)|(2[0-3]))(:[0-5]?\d){2}\b

in the text
00/12/1900 15:14:13

using the Re2::Set class. The result should be TRUE and I should get the match, but instead I'm getting the following error: 
"RE2::Set::Match: match but unknown regexp set"
What happened here? 

Thank you for your help.
Igor.

Russ Cox

unread,
Nov 26, 2012, 9:42:40 AM11/26/12
to Igor Polevoy, re2-dev
Sorry for the delayed reply. It looks like there is a bug in
SearchDFA: it is saying there is a match but did not fill in the
vector with the indexes of the matches. It looks to me like this can
happen if SearchDFA finds itself in "FullMatchState", meaning that it
believes that no matter what text remains, there will be a match at
the end of the string. Fixing this is a little involved, because
that's not a real state, so you can't just fix a few conditionals to
fall through. However, I think you'd only run into this if you created
the Set with anchor=UNANCHORED and then also gave it a regexp that
matched the empty string as one of the members in the set. Is that
true? If not, can you whittle down the test case to a simple main
program I can run?

Thanks.
Russ

Hassan Monfared

unread,
May 12, 2013, 6:26:13 AM5/12/13
to re2...@googlegroups.com, Igor Polevoy, r...@swtch.com
Hi Russ,
I have the same problem.
here is my input :
RE2::Set items ===>  ".{4,}\\.css$"    & ".{4,}\\.js$"

matching against : "http://localhost/style.css"

I fall into this code of RE2 (in both UNANCHORED and anchored ): 
 if (v->size() == 0) {
    LOG(DFATAL) << "RE2::Set::Match: match but unknown regexp set";

does the bug you mentioned already exists in RE2?

Thanks
Reply all
Reply to author
Forward
0 new messages