4 ms·
It is easy to write a regexp with backreferences that cannot be represented by any DFA. So I'd say the correctness of your implementation is doubtful. For exam
by teraflop 3y ago
It is easy to write a regexp with backreferences that cannot be represented by any DFA. So I'd say the correctness of your implementation is doubtful.
For example, the language defined by the regexp /([ab]*)\1/ is neither regular nor context-free.
- tgv 3y agoMy bad. I had missed the fact that it was in the pattern.