Re: Using regexp_replace to remove small words - Mailing list pgsql-general

From Tom Lane
Subject Re: Using regexp_replace to remove small words
Date
Msg-id 7222.1292252434@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using regexp_replace to remove small words  (Vick Khera <vivek@khera.org>)
Responses Re: Using regexp_replace to remove small words  (Vick Khera <vivek@khera.org>)
List pgsql-general
Vick Khera <vivek@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 regexp section.

It's described in the same paragraph that describes regexp_replace, in
http://www.postgresql.org/docs/9.0/static/functions-matching.html

    The regexp_replace function provides substitution of new text for
    substrings that match POSIX regular expression patterns. It has the
    syntax regexp_replace(source, pattern, replacement [, flags ]). The
    source string is returned unchanged if there is no match to the
    pattern. If there is a match, the source string is returned with the
    replacement string substituted for the matching substring. The
    replacement string can contain \n, where n is 1 through 9, to
    indicate that the source substring matching the n'th parenthesized
    subexpression of the pattern should be inserted, and it can contain
    \& to indicate that the substring matching the entire pattern should
    be inserted. Write \\ if you need to put a literal backslash in the
    replacement text. (As always, remember to double backslashes written
    in literal constant strings, assuming escape string syntax is used.)
    The flags parameter is an optional text string containing zero or
    more single-letter flags that change the function's behavior. 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.

            regards, tom lane

pgsql-general by date:

Previous
From: paulo matadr
Date:
Subject: Cluster with LATIN1 and UTF-8
Next
From: Robert Gravsjö
Date:
Subject: Re: RES: Using regexp_replace to remove small words