Re: regexp question - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: regexp question
Date
Msg-id Pine.LNX.4.44.0302220255390.2067-100000@peter.localdomain
Whole thread Raw
In response to regexp question  ("Andy Kriger" <akriger@greaterthanone.com>)
List pgsql-general
Andy Kriger writes:

> select * from table where column ~ '.*\(blah.*\)'
> will return any row with characters-blah-characters
>
> Is there any way I can get just the blah.* portion of the string in my
> result?

Use the substring function.  See the documentation on pattern matching.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: system catalog
Next
From: Neil Conway
Date:
Subject: Re: escaping and sql injection