Re: Notes about fixing regexes and UTF-8 (yet again) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Notes about fixing regexes and UTF-8 (yet again)
Date
Msg-id 25151.1329489583@sss.pgh.pa.us
Whole thread Raw
In response to Re: Notes about fixing regexes and UTF-8 (yet again)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Notes about fixing regexes and UTF-8 (yet again)  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Here's a wild idea: keep the class of each codepoint in a hash table. 
> Initialize it with all codepoints up to 0xFFFF. After that, whenever a 
> string contains a character that's not in the hash table yet, query the 
> class of that character, and add it to the hash table. Then recompile 
> the whole regex and restart the matching engine.

> Recompiling is expensive, but if you cache the results for the session, 
> it would probably be acceptable.

Dunno ... recompiling is so expensive that I can't see this being a win;
not to mention that it would require fundamental surgery on the regex
code.

In the Tcl implementation, no codepoints above U+FFFF have any locale
properties (alpha/digit/punct/etc), period.  Personally I'd not have a
problem imposing the same limitation, so that dealing with stuff above
that range isn't really a consideration anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Command Triggers
Next
From: Andrew Dunstan
Date:
Subject: Re: Notes about fixing regexes and UTF-8 (yet again)