From: | Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com> |
---|---|
To: | Ben-Nes Michael <miki(at)canaan(dot)co(dot)il>, postgres <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Major Problem with locale |
Date: | 2002-09-30 21:15:58 |
Message-ID: | 20020930211558.95503.qmail@web20805.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
--- Ben-Nes Michael <miki(at)canaan(dot)co(dot)il> wrote:
> Hi All
>
> I posted a message about regex pattern matching
> using hebrew letters.
>
If all else fails, and you really want to use regular
expressions, you can "import" the regular expression
capability of a Procedural Language, like:
create or replace function perl_match(text, text)
returns boolean as '
if ($_[0] =~ m/$_[1]/) {return true}
else {return false};
' language 'plperl';
jeck=# select perl_match('a','\\x61');
perl_match
------------
t
(1 row
Note the need to double the backslashes.
Using hex (or octal) escapes will enable you to match
any ascii character. I don't believe that PostgreSQL
regular expressions support this (at least, I couldn't
get it to work).
Perl 5.6 also supports unicode, although I don't know
how that is implemented for regular expression matching.
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-09-30 21:26:01 | Re: [SQL] CURRENT_TIMESTAMP |
Previous Message | Ben-Nes Michael | 2002-09-30 19:17:06 | Major Problem with locale |