Re: Splitting a string containing a numeric value in to three parts

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Splitting a string containing a numeric value in to three parts
Дата
Msg-id 450394410.3030345.1438009614365.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответ на Splitting a string containing a numeric value in to three parts  (Sanjaya Vithanagama <svithanagama@gmail.com>)
Ответы Re: Splitting a string containing a numeric value in to three parts  (Sanjaya Vithanagama <svithanagama@gmail.com>)
Список pgsql-general
Sanjaya Vithanagama <svithanagama@gmail.com> wrote:

> I can match the numeric value and the rest of the string after
> the numeric value using the following:
>
> select regexp_matches('hello+123123.453the-123re',
>                                            '([\+|-]?(?:\d*(?:(?:\.)?\d+)))(.*)')
> outputs array {+123123.453,the-123re}.
>
> Where I am having trouble is with matching the first part of the
> string. In other words what needs to be 'RE' in the following
> expression for it to report the all three elements of the array.
>
> select regexp_matches('hello+123123.453the-123re',
>                                             '((RE)[\+|-]?(?:\d*(?:(?:\.)?\d+)))(.*)')
> should return array {hello,+123123.453,the-123re}.

select regexp_matches('hello+123123.453the-123re',
                      '^(.*?)([\+|-]?(?:\d*(?:(?:\.)?\d+)))(.*)$')

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Connections closing due to "terminating connection due to administrator command"
Следующее
От: Herouth Maoz
Дата:
Сообщение: Re: Connections closing due to "terminating connection due to administrator command"