Search Postgresql Archives

Re: Replacing Ordinal Suffixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "GW" == George Weaver <gweaver@xxxxxxx> writes:

GW> SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'),
GW> E'(\d)(st|nd|rd|th)', E'\1', 'g');
GW>     regexp_replace
GW> ------------------------
GW> 300 north 126th street
GW> (1 row)

The E'' syntax eats your backslashes.  For that version, try just:

SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'),'(\d)(st|nd|rd|th)', '\1', 'g');

-JimC
--
James Cloos <cloos@xxxxxxxxxxx>         OpenPGP: 1024D/ED7DAEA6


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux