D
Don Bruder
I've got a "canned" regexp I'm trying to analyze that I can't quite
follow due to one of the constructs used in it. Can anyone
translate/verify my translation for me?
Here's the segment that's throwing me (It's a very small sub-section of
a rather large and complex regexp - We're talking something on the order
of 300+ characters worth of "rather large and complex")
[a-zA-Z]{2}[.,\;:?%!&+^~`'\$*=\#|013467\(\)\[\]\{\}<>"][a-zA-Z]{2}
Now, if I'm reading rightly, and I'm not totally hopeless as far as my
understanding of perl regexps goes, this should be looking to match "any
two letters followed by pretty much any punctuation mark (including
parens, braces, and brackets of all flavors, but (seemingly) excluding
the "bar" (AKA "OR") character) or any of the digits 0, 1, 3, 4, 6, or
7, followed by any two letters.
How far off base am I with that interpretation?
Should I be ignoring any usual "special meaning" of the 'bar' character
when it appears as part of a square-bracketed set, and therefore taking
the overall regexp to mean that the "bar" character *IS NOT* being
excluded or used in its "special" capacity?
follow due to one of the constructs used in it. Can anyone
translate/verify my translation for me?
Here's the segment that's throwing me (It's a very small sub-section of
a rather large and complex regexp - We're talking something on the order
of 300+ characters worth of "rather large and complex")
[a-zA-Z]{2}[.,\;:?%!&+^~`'\$*=\#|013467\(\)\[\]\{\}<>"][a-zA-Z]{2}
Now, if I'm reading rightly, and I'm not totally hopeless as far as my
understanding of perl regexps goes, this should be looking to match "any
two letters followed by pretty much any punctuation mark (including
parens, braces, and brackets of all flavors, but (seemingly) excluding
the "bar" (AKA "OR") character) or any of the digits 0, 1, 3, 4, 6, or
7, followed by any two letters.
How far off base am I with that interpretation?
Should I be ignoring any usual "special meaning" of the 'bar' character
when it appears as part of a square-bracketed set, and therefore taking
the overall regexp to mean that the "bar" character *IS NOT* being
excluded or used in its "special" capacity?