Re: SELECT substring with regex
От
Rodrigo De Leon
Тема
Re: SELECT substring with regex
Дата
Msg-id
a55915760607071137q2c70346cp5b30cac14beaf1e7@mail.gmail.com
Ответ на
Re: SELECT substring with regex (T E Schmitz)
Список
Дерево обсуждения
SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex Gary Stainburn <gary.stainburn@ringways.co.uk>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex Erik Jones <erik@myemma.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex Richard Broersma Jr <rabroersma@yahoo.com>
Re: SELECT substring with regex Alvaro Herrera <alvherre@commandprompt.com>
Re: SELECT substring with regex Emils <gnudiff@gmail.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex "Aaron Bono" <postgresql@aranya.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex "Rodrigo De Leon" <rdeleonp@gmail.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex "Jim Buttafuoco" <jim@contactbda.com>
Re: SELECT substring with regex "Rodrigo De Leon" <rdeleonp@gmail.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
Re: SELECT substring with regex "Rodrigo De Leon" <rdeleonp@gmail.com>
Re: SELECT substring with regex "Aaron Bono" <postgresql@aranya.com>
Re: SELECT substring with regex T E Schmitz <mailreg@numerixtechnology.de>
On 7/7/06, T E Schmitz wrote:
> But that takes me to the next problem:
>
> For the sake of the example I simplified the regular pattern.
> In reality, BASE_NAME might be:
>
> 28mm
> 28-70mm
>
> So the reg. expr. requires brackets:
>
> substring (NAME, '^(\\d+(-\\d+)?mm)' ) as BASE_NAME
>
> Actually, the pattern is more complex than that and I cannot see how I
> can express it without brackets.
Maybe:
select
substring ('150mm LD AD Asp XR Macro', '^[\\d-]*mm' ) as BASE_NAME
, substring('150mm LD AD Asp XR Macro','^[\\d-]*mm (.*)$') as SUFFIX;
select
substring ('28-70mm LD AD Asp XR Macro', '^[\\d-]*mm' ) as BASE_NAME
, substring('28-70mm LD AD Asp XR Macro','^[\\d-]*mm (.*)$') as SUFFIX;
etc...
Regards,
Rodrigo
В списке pgsql-sql по дате отправления