Re: question about reg. expression

Поиск
Список
Период
Сортировка
От Samuel Gendler
Тема Re: question about reg. expression
Дата
Msg-id AANLkTi=guS5T46M5wt7VXH8_0SfZ-_D+uG6Y=68FAFWJ@mail.gmail.com
обсуждение исходный текст
Ответ на question about reg. expression  (andrew1 <andrew1@mytrashmail.com>)
Ответы Re: question about reg. expression  (Stephen Belcher <sycobuny@malkier.net>)
Список pgsql-sql
I'd think you need to indicate multiple alphabetic matches.  Your first regex actually matches only b followed by end of string and the second is really only matching start of string followed by a.  The third is looking for a single character string.

Try this: select 'ab' ~ '^[a-z]+$'
or this: select 'ab' ~ '^[a-z]*$'

or if looking only for 2 character strings: select 'ab' ~ '^[a-z][a-z]$'

On Tue, Jan 18, 2011 at 3:41 PM, andrew1 <andrew1@mytrashmail.com> wrote:
hi all,

these return t:
select 'ab' ~ '[a-z]$'
select 'ab' ~ '^[a-z]'

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

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

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

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

Предыдущее
От: andrew1
Дата:
Сообщение: question about reg. expression
Следующее
От: Stephen Belcher
Дата:
Сообщение: Re: question about reg. expression