UNICODE and regex character classes - Mailing list pgsql-novice

From David Norris
Subject UNICODE and regex character classes
Date
Msg-id cb1657590408041510425ddeb9@mail.gmail.com
Whole thread Raw
Responses Re: UNICODE and regex character classes
List pgsql-novice
All,

I'm trying to create a regular expression that plays nice with UNICODE
strings. I'd like to allow any alphabetic or digit character (as
defined by its UNICODE category) in a username. I've already set the
database's encoding to UNICODE and it's working properly as far as
being able to store and retrieve proper multibyte strings.

So I tried this regular expression:
"^[[:alpha:]][[:alpha:][:digit:]_]{2,}$". But :alpha: only matches
"pure" ASCII alphabetics, and [:digit:] only matches ASCII '0' thru
'9'. Is there another named class I can use for this, like
[:unicodealpha:]? If not, what's the best way to achieve this?

I wasn't able to find anything on Google, so I would really be
grateful for suggestions or links to websites that talk about this.

Thanks so much!
--
David Norris
danorris@gmail.com

pgsql-novice by date:

Previous
From: Frank Voellmann
Date:
Subject: Column name truncation
Next
From: David Norris
Date:
Subject: Re: UNICODE and regex character classes