[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Major Problem with locale
From:       Jeff Eckermann <jeff_eckermann () yahoo ! com>
Date:       2002-09-30 21:15:58
[Download RAW message or body]


--- Ben-Nes Michael <miki@canaan.co.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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic