Re: regexp_replace - Mailing list pgsql-sql

From Marcin Krawczyk
Subject Re: regexp_replace
Date
Msg-id 95f6bf9b0808010525p3d853c05n9247827e44c154b4@mail.gmail.com
Whole thread Raw
In response to Re: regexp_replace  ("Pawel Socha" <pawel.socha@gmail.com>)
List pgsql-sql
thanks / dzieki

regards / pozdrowienia
mk

2008/8/1 Pawel Socha <pawel.socha@gmail.com>:
> 2008/8/1 Marcin Krawczyk <jankes.mk@gmail.com>
>>
>> Hi all. I'd like to know whether it's possible to reverse the
>> behaviour of regexp_replace, meaning :
>> now if I do
>> SELECT regexp_replace ('foobarbaz', 'b..', 'X') I get 'fooXbaz' - it
>> replaces the string that matches given pattern with 'X', how do I
>> achieve the opposite - replace the string that doesn't match the
>> pattern ?
>>
>> regards
>> mk
>>
>> --
>> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-sql
>
>
>
> merlin=# SELECT regexp_replace ('foobarbaz', '[^b]', 'X', 'g');
>  regexp_replace
> ----------------
>  XXXbXXbXX
> (1 row)
>
>
> --
> --
> Serdecznie pozdrawiam
>
> Pawel Socha
> pawel.socha@gmail.com
>
> programista/administrator
>
> perl -le 's**02).4^&-%2,).^9%4^!./4(%2^3,!#+7!2%^53%2&**y%& -;^[%"`-{
> a%%s%%$_%ee'
>


pgsql-sql by date:

Previous
From: "Pawel Socha"
Date:
Subject: Re: regexp_replace
Next
From: "EXT-Rothermel, Peter M"
Date:
Subject: Savepoints and SELECT FOR UPDATE in 8.2