UNICODE and regex character classes

Поиск
Список
Период
Сортировка
От David Norris
Тема UNICODE and regex character classes
Дата
Msg-id cb1657590408041510425ddeb9@mail.gmail.com
обсуждение исходный текст
Ответы Re: UNICODE and regex character classes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Frank Voellmann
Дата:
Сообщение: Column name truncation
Следующее
От: David Norris
Дата:
Сообщение: Re: UNICODE and regex character classes