Re: question about reg. expression

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: question about reg. expression
Дата
Msg-id ihe69f$hl3$2@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на question about reg. expression  (andrew1 <andrew1@mytrashmail.com>)
Список pgsql-sql
On 2011-01-18, andrew1 <andrew1@mytrashmail.com> wrote:
> hi all,
>
> these return t:
> select 'ab' ~ '[a-z]$'

this matches the b and the end of the string

> select 'ab' ~ '^[a-z]'

this matches the start of the string and the a

> select 'ab' ~ '^[a-z]$' returns f

> Can't I use ^ and $ at the same time to match, in this case?
> thanks.

the above expression only succeeds if the string is one character long

use '+' '*' or '{2}' etc after the '[a-z]' to allow it to match several letters

or use '^[a-z]|[a-z]$' to match any sting that starts or ends with a
letter.

what are you trying to find?




-- 
⚂⚃ 100% natural


В списке pgsql-sql по дате отправления:

Предыдущее
От: MoNiLlO
Дата:
Сообщение: Control reached end of trigger procedure without RETURN
Следующее
От: Adelo Herrero Pérez
Дата:
Сообщение: Control reached end of trigger procedure without RETURN