[PR 61424] std::regex matches right to left, not leftmost longest
Jonathan Wakely
jwakely@redhat.com
Tue Jun 10 16:54:00 GMT 2014
>diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc
>index a81f517..6a1faaf 100644
>--- a/libstdc++-v3/include/bits/regex.tcc
>+++ b/libstdc++-v3/include/bits/regex.tcc
>@@ -70,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> // without defining a macro. Users should define
> // _GLIBCXX_REGEX_USE_THOMPSON_NFA if they need to use this approach.
> bool __ret;
>- if (!__re._M_automaton->_M_has_backref
>+ if (!(__re._M_flags & regex_constants::ECMAScript)
> #ifndef _GLIBCXX_REGEX_USE_THOMPSON_NFA
> && __policy == _RegexExecutorPolicy::_S_alternate
> #endif
I'm sure this is because I still don't understand all the regex code,
but doesn't this change mean that for an "extended" mode regex with
backrefs, the user could define _GLIBCXX_REGEX_USE_THOMPSON_NFA and
backrefs wouldn't work?
More information about the Libstdc++
mailing list