| From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: r trim of characters other than space |
| Date: | 2006-02-09 06:35:51 |
| Message-ID: | 20060209063551.GA2458@webserv.wug-glas.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
am 09.02.2006, um 11:54:43 +0530 mailte surabhi.ahuja folgendes:
> Hi
> hi i have varchar type fiels in a table.
>
> i want to make the following check,
>
> if it is having carets in the end, then those carets be removed.
>
> so if i get a string like abc def^^^^
>
> i should be able to get abc def
Which version? I have 8.1 and can use regexp_replace for this:
test=# select 'abc def^^^^';
?column?
-------------
abc def^^^^
(1 row)
test=# select regexp_replace('abc def^^^^','[\\^]*$','');
regexp_replace
----------------
abc def
(1 row)
HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2006-02-09 07:19:19 | Re: r trim of characters other than space |
| Previous Message | surabhi.ahuja | 2006-02-09 06:24:43 | r trim of characters other than space |