3 ms·
Yes, but you're taking too much. Without grouping, regex is weaker than regular languages. Grouping & capturing parentheses can stay. It's only the back-referr
by trisiak 7y ago
Yes, but you're taking too much. Without grouping, regex is weaker than regular languages.
Grouping & capturing parentheses can stay. It's only the back-referrences that you need to remove.
- gbacon 7y agoRegex matching with backreferences is NP-hard. https://perl.plover.com/NPC/ https://perl.plover.com/NPC/
- saltcured 7y agoGrouping is very useful, but I think you can get pretty far in practical patterns with a limit of k-nesting for k=0..3 or so. That pattern language would still be regular.