Quote:
Originally Posted by Manichean
Just tested in Python, so, if I'm right, "(1|2)+" would actually be equivalent to "[12]+"?
|
Isn't this entire subject a bit esoteric for the beginner? Most beginners just need to know that (John|Bill) can be used, not how the quantifiers apply to OR'd expressions. For single characters, they should just use square brackets and then apply the quantifier. As to the underlying issue, it wouldn't surprise me if different implementations of regex handle this differently.
BTW, I refer to "|" as the "vertical bar," not "pipe" and in the regex context I've seen it formally referred to as the "alternation operator" or, more commonly, just "OR" or the "OR operator" The term "pipe" has a pretty specific meaning in *nixLand (and in WindowsLand) and it has nothing to do with alternation or OR. There could be confusion there.