2 ms·
`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.
by 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.