Re: regexp idea

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: regexp idea
Дата
Msg-id 521D04B2.9000501@gmail.com
обсуждение исходный текст
Ответ на regexp idea  (AI Rumman <rummandba@gmail.com>)
Ответы Re: regexp idea  (AI Rumman <rummandba@gmail.com>)
Список pgsql-general
On 08/27/2013 12:44 PM, AI Rumman wrote:
> Hi,
>
> I have a string like:
> Gloucester Catholic vs. St. Augustine baseball, South Jersey
> Non-Public A final, June 5, 2013
>
> I need to extract date part from the string.
>
> I used the follows:
> regexp_matches(title,'[.* ]+\ (Jul|August|Sep)[, a-zA-Z0-9]+' )
>
> But it gives me result August as it stops at "Augustine".
>
> In my case, date can be in different formats, some record may use ","
> or some may not.
>
> Any idea to achieve this?
>
> Thanks.
select regexp_replace('Gloucester Catholic vs. St. Augustine baseball,
South Jersey Non-Public A final, June 5, 2013',
E'(^.*)(\\m(June|July|August|Sep))([, a-zA-Z0-9]+)', E'\\2 \\4' );
+----------------+
| regexp_replace |
+----------------+
| June  5, 2013  |
+----------------+
(1 row)



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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Pgbouncer help
Следующее
От: AI Rumman
Дата:
Сообщение: Re: regexp idea