Re: Getting unexpected results from regexp_replace

2021-02-21 Thread Dan Nessett
Thanks. Doubling the backslashes did the trick. I tried to use the original expression without the E, but postgres threw an error and said to use the ā€œEā€ version of the pattern. Dan > On Feb 21, 2021, at 8:50 AM, Tom Lane wrote: > > Dan Nessett writes: >> SELECT user_name, regexp_replace(use

Re: Getting unexpected results from regexp_replace

2021-02-21 Thread Tom Lane
Dan Nessett writes: > SELECT user_name, regexp_replace(user_email, E'\(.*\)', '') AS user_email, > family_list, street_address, city, state, zip, phone_list, email_list > FROM "household_data" > WHERE email_list != ā€˜'; Because you used E'...', the backslashes are eaten by the string literal pars