Re: Allow Reg Expressions in Position function

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: Allow Reg Expressions in Position function
Дата
Msg-id CAD3a31Vy3RAmW56GpztNchOxKf8JOk4sPpT=VMXT237WHxpq-Q@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
If I correctly understood what you wanted based on the SO description ("Something like: select position ('/s/' or '/b/' or '/t/' in URL)"),

you could do that by combining SUBSTRING with position.  Something like:

SELECT position(substring(URL FROM '/(s|b|t)/') IN URL);

Cheers,

Ken

On Sun, Aug 19, 2018 at 11:27 PM Nick Dro <postgresql@walla.co.il> wrote:
Position function allows only string as pattern parameter:
 
select position(sub-string in string)
 
If you are looking for more than one sub-string you can't do it with a single call to position.
More info: 
 
 
Required solution: make sub-string accept regular expression just like the LIKE operator.


--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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

Предыдущее
От: TalGloz
Дата:
Сообщение: Re: including header files in a C extension
Следующее
От: Geoff Winkless
Дата:
Сообщение: Re: Re: Allow Reg Expressions in Position function