Re: back references using regex

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Matthew Peter <survivedsushi(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: back references using regex
Date: 2005-09-11 00:00:49
Message-ID: 20050911000049.GA47332@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Henrique Reimer 2005-09-11 00:45:19 Re: locale and encoding
Previous Message Ben 2005-09-10 23:48:43 Re: to_ascii, or some other form of magic transliteration