perlmonger: (bleurgh)
perlmonger ([personal profile] perlmonger) wrote2007-09-18 02:32 pm
Entry tags:

Standards

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.

[identity profile] easterbunny.livejournal.com 2007-09-18 02:02 pm (UTC)(link)
MySQL 5 and Java 1.4.2 don't have compatible regular expressions? (Crap. I've probably broken something.)

[identity profile] alexmc.livejournal.com 2007-09-18 02:46 pm (UTC)(link)
You use regular expressions in MySQL?

*boggle*
ext_17706: (Default)

[identity profile] perlmonger.livejournal.com 2007-09-18 03:13 pm (UTC)(link)
It's useful! A pity they've only made it available as a LIKE-alike in queries though; would be handy as a general string mangling facility in stored procedures too.

[identity profile] alexmc.livejournal.com 2007-09-18 02:45 pm (UTC)(link)
There comes a point where you just have to say "fuck it, I'll do it in perl".
ext_17706: (Default)

[identity profile] perlmonger.livejournal.com 2007-09-18 03:20 pm (UTC)(link)
On several occasions, I've done just that.

Back in the days of ColdFusion 5, I had code that was an order of magnitude faster if I wrote a file in CF, shelled out to perl script that wrote its filtered output to another file, and read that file back into CF, than if I wrote the same expressions using CF's own regexp functions.