Search Postgresql Archives

Re: regexp replace?

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

 



On Thu, 6 May 2004, CSN wrote:

> I'd like to create a function that will take strings
> like:
> 
> abcdef 'quote1' "quote2" / xyz etc.
> 
> and return:
> 
> abcdef-quote1-quote2-xyz-etc.
> 
> Basically remove all characters that aren't
> [A-Za-z0-9], -, or ., and replace all spaces with
> hyphens. Possible? The only string function that
> supports regular expressions is substring and I
> couldn't make that do what I want.

I think translate may be able to do what you want pretty handily.  May 
take two passes, i.e. a subselect.


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[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