Re: back references using regex - Mailing list pgsql-general

From Michael Fuhr
Subject Re: back references using regex
Date
Msg-id 20050911000049.GA47332@winnie.fuhr.org
Whole thread Raw
In response to Re: back references using regex  (Matthew Peter <survivedsushi@yahoo.com>)
Responses Re: back references using regex
List pgsql-general
On Sat, Sep 10, 2005 at 10:27:13AM -0700, Matthew Peter wrote:
> ahhhhhhhhh I swear I never came across any of these
> gems of information in the docs. It was these subtle
> differences that were throwing me.

From "Regular Expression Escapes" in the "Pattern Matching" section
of the manual:

  A back reference (\n) matches the same string matched by the
  previous parenthesized subexpression specified by the number n
  (see Table 9-18).  For example, ([bc])\1 matches bb or cc but not
  bc or cb.  The subexpression must entirely precede the back
  reference in the RE.  Subexpressions are numbered in the order
  of their leading parentheses.  Non-capturing parentheses do not
  define subexpressions.

http://www.postgresql.org/docs/8.0/static/functions-matching.html#POSIX-ESCAPE-SEQUENCES

--
Michael Fuhr

pgsql-general by date:

Previous
From: Ben
Date:
Subject: Re: to_ascii, or some other form of magic transliteration
Next
From: Carlos Henrique Reimer
Date:
Subject: Re: locale and encoding