View Single Post
Old 09-27-2010, 10:00 AM   #68
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Manichean View Post
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.
Starson17 is offline