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 pete...@gmx.net 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

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 henri...@vivver.com.br 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

Re: [GENERAL] Using regexp_replace to remove small words

2010-12-13 Thread Tom Lane
Vick Khera vi...@khera.org 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

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 t...@sss.pgh.pa.us 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

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. -- http://www.vivver.com.br/ *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' );