Using regexp_replace to remove small words

Поиск
Список
Период
Сортировка
От Henrique de Lima Trindade
Тема Using regexp_replace to remove small words
Дата
Msg-id 001701cb9868$6e402770$4ac07650$@com.br
обсуждение исходный текст
Ответы Re: Using regexp_replace to remove small words  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general

Hi,

 

I'm trying to find a regular expression that removes all small (length < N) words from a string. But, until now I've not been successful.

 

For example:

 

If I pass 'George W Bush' as parameter, I want regexp_replace to return 'George Bush'.

 

Other examples are:

 

select regexp_replace( 'Tommy Lee Jones', 'REGEX', ' ', 'g' )    => 'Tommy Jones'

select regexp_replace( 'Dr Tommy Lee Jones', 'REGEX', ' ', 'g' ) => 'Tommy Jones'

select regexp_replace( 'Tommy Lee Jones Jr', 'REGEX', ' ', 'g' ) => 'Tommy Jones'

 

Thanks in advance,

 

 

HENRIQUE TRINDADE

ANALISTA DE SISTEMA II

( 55 (31) 3025-3550

+henrique@vivver.com.br

assinatura

 

Вложения

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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Re: A cronjob for copying a table from Oracle
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Extended query protocol and exact types matches.