42 ms·
Minor nitpick: A{2,4} becomes AA(|A|AA), not AA(A|AA).
by Twisol 8y ago
Minor nitpick: A{2,4} becomes AA(|A|AA), not AA(A|AA).
- jrochkind1 8y ago`AA(|A|AA)` is valid regexp syntax? Holy moly it is! I had no idea you could put a | right after parens like that! I guess (|A) is nothing or A? Woah.
- Twisol 8y agoYep! It's equivalent to `AA(A|AA)?`, by way of the parent's reduction for `?`, but it's a nice option when you want to emphasize some kind of symmetry.
- jmts 8y agoWell spotted. Thanks for providing the correct derivation.