Standards

Sep. 18th, 2007 02:32 pm
perlmonger: (bleurgh)
[personal profile] perlmonger
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.

(no subject)

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

(no subject)

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

*boggle*

(no subject)

Date: 2007-09-18 03:13 pm (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
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.

(no subject)

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

(no subject)

Date: 2007-09-18 03:20 pm (UTC)
ext_17706: (Default)
From: [identity profile] perlmonger.livejournal.com
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.

Profile

perlmonger: (Default)
perlmonger

July 2013

S M T W T F S
 123456
78910111213
14 151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Powered by Dreamwidth Studios