Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner
On Tue, 6 Feb 2018 17:57:33 +0100, Francisco Olarte wrote: >So, no question mark sent, I suspect your mail chain may be playing >tricks on you, or may be you are translating to 7 bits on purpose >since your mail came with the headers: > >Content-Type: text/plain; charset=us-ascii >Content-Tr

Re: Regex Replace with 2 conditions

2018-02-06 Thread Francisco Olarte
George: On Tue, Feb 6, 2018 at 4:46 PM, George Neuner wrote: > On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte > wrote: >>I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN >>BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET. I made a typo there, 0..127, not 128 ( or

Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner
On 2/6/2018 10:52 AM, David G. Johnston wrote: On Tue, Feb 6, 2018 at 8:46 AM, George Neuner >wrote: On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte mailto:fola...@peoplecall.com>> wrote: >I repeat for the last time. YOU ARE NOT USING ASCII. ASCII

Re: Regex Replace with 2 conditions

2018-02-06 Thread David G. Johnston
On Tue, Feb 6, 2018 at 8:46 AM, George Neuner wrote: > On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte > wrote: > > > >I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN > >BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET. > > What ASCII table are you reading? The q

Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner
On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte wrote: >I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN >BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET. What ASCII table are you reading? The question mark symbol is #63. It lies between the numbers and the capi

Re: Regex Replace with 2 conditions

2018-02-05 Thread Francisco Olarte
Denisa: 1.- Please, do not top-post, it makes seeing what you arereplying to difficult. 2.- Do not reply to several messages in one. Nobody reading this knows my suggestions. Having said that, regarding my part: On Mon, Feb 5, 2018 at 5:54 PM, Denisa Cirstescu wrote: > I've tried the version t

RE: Regex Replace with 2 conditions

2018-02-05 Thread Denisa Cirstescu
x27;', 'g'); $$ LANGUAGE sql IMMUTABLE; Thanks a lot, Denisa Cîrstescu -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Monday, February 5, 2018 4:43 PM To: Denisa Cirstescu Cc: pgsql-gene...@postgresql.org Subject: Re: Regex Replace with 2 c

Re: Regex Replace with 2 conditions

2018-02-05 Thread David G. Johnston
On Mon, Feb 5, 2018 at 6:34 AM, Denisa Cirstescu < denisa.cirste...@tangoe.com> wrote: > Is there a way to specify 2 conditions in regexp_replace? > ​Tom and Francisco ​both give excellent responses. I have written a SQL function that achieves this, but I am not happy with > it because it is har

Re: Regex Replace with 2 conditions

2018-02-05 Thread Tom Lane
Denisa Cirstescu writes: > Is there a way to specify 2 conditions in regexp_replace? > I need an SQL function that eliminates all ASCII characters from 1-255 that > are not A-Z, a-z, 0-9, and special characters % and _ so something like: > SELECT regexp_replace(p_string, E'[' || CHR(1) || '-' ||

Re: Regex Replace with 2 conditions

2018-02-05 Thread Francisco Olarte
Denisa: On Mon, Feb 5, 2018 at 2:34 PM, Denisa Cirstescu wrote: > I need an SQL function that eliminates all ASCII characters from 1-255 that > are not A-Z, a-z, 0-9, and special characters % and _ so something like: Are you aware ASCII is a SEVEN bit code ? And now, why don't you just write t

Regex Replace with 2 conditions

2018-02-05 Thread Denisa Cirstescu
Hi all, Is there a way to specify 2 conditions in regexp_replace? I need an SQL function that eliminates all ASCII characters from 1-255 that are not A-Z, a-z, 0-9, and special characters % and _ so something like: SELECT regexp_replace(p_string, E'[' || CHR(1) || '-' || CHR(255) || '&&[^A-Za-