Search Postgresql Archives

Using regexp_replace to remove small words

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx

assinatura

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux