Re: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Vick Khera
On Mon, Dec 13, 2010 at 10:00 AM, Tom Lane wrote: > Flag i >    specifies case-insensitive matching, while flag g specifies >    replacement of each matching substring rather than only the first >    one. Other supported flags are described in Table 9-19. Thanks. Quite well hidden in plain sight

Re: RES: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Robert Gravsjö
Eisentraut [mailto:pete...@gmx.net] Enviada em: sexta-feira, 10 de dezembro de 2010 20:59 Para: Henrique de Lima Trindade Cc: pgsql-general@postgresql.org Assunto: Re: [GENERAL] Using regexp_replace to remove small words On fre, 2010-12-10 at 10:47 -0200, Henrique de Lima Trindade wrote: I

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Tom Lane
Vick Khera writes: > speaking of regular expressions... the other day I was trying to find > where the 'flags' option to regexp_replace() is described, but I > cannot find it in the 9.0 manual in any obvious place. it is not > described in the string functions section, nor in the regexp section.

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Vick Khera
On Mon, Dec 13, 2010 at 7:24 AM, Henrique de Lima Trindade wrote: > Your example works perfectly. But, I need Your help with on another situation. > We're trying to create a plpgsql function with the expression. But, I'm > getting a syntax error: You're using $$ quoting for the function, and $$

RES: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Henrique de Lima Trindade
e Lima Trindade Cc: pgsql-general@postgresql.org Assunto: Re: [GENERAL] Using regexp_replace to remove small words On fre, 2010-12-10 at 10:47 -0200, Henrique de Lima Trindade wrote: > I'm trying to find a regular expression that removes all small (length < N) > words from a strin

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Vick Khera
On Fri, Dec 10, 2010 at 5:59 PM, Peter Eisentraut wrote: > select regexp_replace('Tommy Lee Jones', $$\y\w{2,3}\y$$, ' ', 'g' ); > speaking of regular expressions... the other day I was trying to find where the 'flags' option to regexp_replace() is described, but I cannot find it in the 9.0 manua

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-11 Thread rodrigo mendonca
Hi Peter, your REGEX is exactly what we were trying to find. Thank you very much! Rodrigo. -- *Rodrigo Mendonça** Diretor de Tecnologia Tel: 31 3025 3550 / Cel: 31 8489 3119 rodr...@vivver.com.br / direto...@vivver.com.br*

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-10 Thread Peter Eisentraut
On fre, 2010-12-10 at 10:47 -0200, Henrique de Lima Trindade wrote: > 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. Here is a start: select regexp_replace('Tommy Lee Jones', $$\y\w{2,3}\y$$, ' ', 'g' );

[GENERAL] Using regexp_replace to remove small words

2010-12-10 Thread Henrique de Lima Trindade
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_rep