Re: regexp_replace

From: "Marcin Krawczyk" <jankes(dot)mk(at)gmail(dot)com>
To: "Pawel Socha" <pawel(dot)socha(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: regexp_replace
Date: 2008-08-01 12:25:32
Message-ID: 95f6bf9b0808010525p3d853c05n9247827e44c154b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

thanks / dzieki

regards / pozdrowienia
mk

2008/8/1 Pawel Socha <pawel(dot)socha(at)gmail(dot)com>:
> 2008/8/1 Marcin Krawczyk <jankes(dot)mk(at)gmail(dot)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(at)postgresql(dot)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(dot)socha(at)gmail(dot)com
>
> programista/administrator
>
> perl -le 's**02).4^&-%2,).^9%4^!./4(%2^3,!#+7!2%^53%2&**y%& -;^[%"`-{
> a%%s%%$_%ee'
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message EXT-Rothermel, Peter M 2008-08-01 17:02:04 Savepoints and SELECT FOR UPDATE in 8.2
Previous Message Pawel Socha 2008-08-01 12:14:35 Re: regexp_replace