Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group