3 ms·
regex engines like PCRE can: ^(\((?1)?\))$
by oftenwrong 9y ago
regex engines like PCRE can:
^(\((?1)?\))$
- swiley 9y agoIf it can then it's not "regular expressions."
- dozzie 9y agoWhich is very computer-science-y approach, and totally uninteresting at that, because the (?PARNO) syntax is still embedded in the same regexp engine for any practical purpose or distinction. If you didn't know, a regexp engine with capture groups is already stronger than what in formal languages theory is called "regular expressions".
- kbp 9y agoBut when most of the commonly used "regular expression" libraries aren't regular, I think if you really mean solving something with only regular expressions, you should probably specify that explicitly. The term's been corrupted enough that using it by itself to rule out things like backreferences isn't clear communication.
- loup-vaillant 9y agoThat's a shame, because regular grammars have a very important property: they're processed with a Finite State Automaton. This makes them blazing fast and quite memory efficient. (Heck, even with a non-deterministic one they're fast.)