[Bug libstdc++/85472] Regex match bug
haberg-1 at telia dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 25 08:45:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85472
--- Comment #4 from Hans Åberg <haberg-1 at telia dot com> ---
(In reply to Tim Shen from comment #1)
> I know exactly how libc++ produces this result. It creates an empty
> match_result during each repetition ("*" operator). It's less confusing but
> much slower.
I wrote an NFA/DFA that computes all matches, it seems, in an efficient manner:
Action numbers are marked on the states of the sub-NFAs one is interested in.
While lexing a string, the partial reverse NFA is recorded, which is searched
when a final state is encountered. The string position action numbers, as
marked on the corresponding states, are recorded, and for each action number,
the contiguous string sequences are the possible submatches.
More information about the Gcc-bugs
mailing list