It’s just occurred to me that, since I’ve had reason to start occasionally using java.util.regex in ColdFusion code, I’m now programming with five incompatible regexp engines, which is nice. That’s Perl 5.8, CFMX 7, java 1.4.2, MySQL 5 and the LCD of current browser javascript regexp implementations. Then there’s the Emacs Lisp variant in XEmacs, and grep itself, neither of which is the same as any of the preceding.
Mostly it’s not too horrific, but remembering what supports +ve/-ve lookahead/lookbehind assertions, and which combination of character class syntax definitions both work and work in the same way is… irritating. Is ‘\w’ [a-zA-Z0-9_] or [\p{L}\p{N}_]? Why doesn’t java do POSIX named entities? Why doesn’t CFMX 7, which AFAIAA actually uses the java engine under its hood, support UNICODE \p{} escapes? Why on Earth does MySQL 5 reverse the meanings of ‘\’ and ‘\\’?
I’ll shut up now.
Mostly it’s not too horrific, but remembering what supports +ve/-ve lookahead/lookbehind assertions, and which combination of character class syntax definitions both work and work in the same way is… irritating. Is ‘\w’ [a-zA-Z0-9_] or [\p{L}\p{N}_]? Why doesn’t java do POSIX named entities? Why doesn’t CFMX 7, which AFAIAA actually uses the java engine under its hood, support UNICODE \p{} escapes? Why on Earth does MySQL 5 reverse the meanings of ‘\’ and ‘\\’?
I’ll shut up now.