3 ms·
Yeah, that's a good case to be aware of. I do mention it in the book while discussing anchors (indicating alternatives have their own independent anchors) [0]
by asicsp 5y ago
Yeah, that's a good case to be aware of.
I do mention it in the book while discussing anchors (indicating alternatives have their own independent anchors) [0] and grouping [1].
I also discuss how `re.fullmatch` is useful, especially when constructing an alternation pattern from a list of terms. Easier to use fullmatch instead of manually adding a group and string anchors.
[0] https://learnbyexample.github.io/py_regular_expressions/alternation-and-grouping.html#alternation https://learnbyexample.github.io/py_regular_expressions/alte...
[1] https://learnbyexample.github.io/py_regular_expressions/alternation-and-grouping.html#grouping https://learnbyexample.github.io/py_regular_expressions/alte...