Count occurrences of pattern in string

Поиск
Список
Период
Сортировка
От dario.ber@libero.it
Тема Count occurrences of pattern in string
Дата
Msg-id 22733682.723081256058266115.JavaMail.defaultUser@defaultHost
обсуждение исходный текст
Ответы Re: Count occurrences of pattern in string
Список pgsql-general
Hello,

I'm looking for a function to count the occurrences of a pattern in a
string. E.g. something like:

fun_count_pattern('fooXblaX', 'X')

which would
return 2 (I.e. pattern 'X' found 2 times in string 'fooXblaX').

I could write
my own function for this (probably using plpython?) but I was wandering whether
there is some function or combination of functions that I could use 'off-the-
shelf'.

Thanks very much

All the best

Dario

PS: I'm using PostgreSQL 8.3 on
Windows XP.

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

Предыдущее
От: Gerhard Wiesinger
Дата:
Сообщение: Re: OT: Re: [sfpug] 10/13 SFPUG meeting, "The Mighty GUCS," video now available
Следующее
От: Wolfgang Keller
Дата:
Сообщение: Re: multi-company design/structure ?