This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR 61424] std::regex matches right to left, not leftmost longest


On Tue, Jun 10, 2014 at 1:56 PM, Tim Shen <timshen91@gmail.com> wrote:
> On Tue, Jun 10, 2014 at 9:54 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>> 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?
>
> Sorry I missed that basic POSIX (BRE) has back-references (damn!), but
> extended POSIX (ERE) doesn't. So it should look like:
> -      if (!__re._M_automaton->_M_has_backref
> +      if (!(__re._M_automaton->_M_has_backref || (__re._M_flags &
> regex_constants::ECMAScript))
> ...and all deleted _M_has_backref lines should be undeleted.
>
> This patch is a temporary (I'm not sure how long though) workaround;
> BFS's support for ECMAScript with no back-references shall be done
> finally.

Sorry for late; this is the complete patch.

Bootstrapped and tested.

Thanks!


-- 
Regards,
Tim Shen

Attachment: a.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]