Re: large document multiple regex

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Jim Nasby" <decibel(at)decibel(dot)org>
Cc: "postgres general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: large document multiple regex
Date: 2007-02-02 17:00:27
Message-ID: b42b73150702020900o25e1ed55t26e2331cb303ebf2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/1/07, Jim Nasby <decibel(at)decibel(dot)org> wrote:
> Have you thought about something like ~ '(first_string|second_string|
> third_string)'? Obviously your example would be more complex, but I
> believe that with careful crafting, you can get regex to do a lot
> without resorting to multiple passes.

that doesn't work...i researched the problem further and found that
postgresql regex implementation has the built in limitation to quit
scanning after the first matched group (this is noted in the
documentation). There is no way that I can see to extract two or more
non contiguous text chunks in a single regex.

To do it properly, you need to have the sophistication of perl regex
with it's magic variables.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2007-02-02 17:03:47 Re: Predicted lifespan of different PostgreSQL branches
Previous Message Ron Johnson 2007-02-02 16:51:56 Re: Converting 7.x to 8.x