- Original Message -
From: Steve Atkins
I suspect you have standard_conforming_strings set to off (it defaults to
on in 9.1), possibly for backwards compatibility to support an app you’re
using that’s not been updated, possibly accidentally.
You're right - it was off (now On). Th
On Mar 1, 2014, at 11:45 AM, George Weaver wrote:
>
>> Actually, I found that the double backslashes are required whether the E is
>> used or not:
>
>> You must be using a relatively old PG version then. Default behavior
>> since around 9.1 has been that backslashes aren't special except
>> i
Actually, I found that the double backslashes are required whether the E
is
used or not:
You must be using a relatively old PG version then. Default behavior
since around 9.1 has been that backslashes aren't special except
in E'' strings.
Hmm.
development=# select version();
"George Weaver" writes:
> Actually, I found that the double backslashes are required whether the E is
> used or not:
You must be using a relatively old PG version then. Default behavior
since around 9.1 has been that backslashes aren't special except
in E'' strings.
reg
Hi All,
From: James Cloos
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');
Actually, I found that the double backslashes are required whether the E is
used or not:
development=# se
George Weaver wrote:
> Hi Ian,
>
> I just got that as well - awesome!
http://xkcd.com/1313/
--
Álvaro Herrerahttp://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make ch
> "GW" == George Weaver 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:
SEL
From: Ian Lawrence Barwick
- Original Message - From: Steve Atkins
On Feb 28, 2014, at 2:43 PM, George Weaver wrote:
>Maybe this?
>select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
>'\1', 'gi');
Hi Steve,
Thanks, but no luck:
select regexp_replace('300 No
2014-03-01 8:16 GMT+09:00 George Weaver :
>
>> - Original Message - From: Steve Atkins
>
>
>> On Feb 28, 2014, at 2:43 PM, George Weaver wrote:
>>
>> >Maybe this?
>>
>> >select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
>> >'\1', 'gi');
>>
>> Hi Steve,
>>
>> Thanks, b
- Original Message -
From: Steve Atkins
To: pgsql-general
Sent: Friday, February 28, 2014 4:17 PM
Subject: Re: [GENERAL] Replacing Ordinal Suffixes
On Feb 28, 2014, at 2:04 PM, George Weaver wrote:
Hi list,
I'm stumped.
I am trying to use Regexp_Replace to replace or
- Original Message -
From: Steve Atkins
On Feb 28, 2014, at 2:43 PM, George Weaver wrote:
>Maybe this?
>select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
>'\1', 'gi');
Hi Steve,
Thanks, but no luck:
select regexp_replace('300 North 126th Street', E'(\d+)(?:
On Feb 28, 2014, at 2:43 PM, George Weaver wrote:
> From: Steve Atkins
>
> >Maybe this?
>
> >select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
> >'\1', 'gi');
>
> Hi Steve,
>
> Thanks, but no luck:
>
> select regexp_replace('300 North 126th Street', E'(\d+)(?:st|nd|rd
From: Steve Atkins
On Feb 28, 2014, at 2:04 PM, George Weaver wrote:
> Hi list,
>
> I'm stumped.
>
> I am trying to use Regexp_Replace to replace ordinal suffixes in addresses
> (eg have '126th' want '126') for comparison purposes. So far no luck.
>
> I have found that
>
> SELECT REGEXP_REPLAC
From: Paul Jungwirth
Try this:
SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'),
'(\d)(st|nd|rd|th)', '\1', 'g');
Hi Paul,
No luck...
SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'), E'(\d)(st|nd|rd|th)',
E'\1', 'g');
regexp_replace
300 north 126t
This is a kick *ss forum. I must say.
On Fri, 2014-02-28 at 14:17 -0800, Steve Atkins wrote:
> On Feb 28, 2014, at 2:04 PM, George Weaver wrote:
>
> > Hi list,
> >
> > I'm stumped.
> >
> > I am trying to use Regexp_Replace to replace ordinal suffixes in addresses
> > (eg have '126th' want
On Feb 28, 2014, at 2:04 PM, George Weaver wrote:
> Hi list,
>
> I'm stumped.
>
> I am trying to use Regexp_Replace to replace ordinal suffixes in addresses
> (eg have '126th' want '126') for comparison purposes. So far no luck.
>
> I have found that
>
> SELECT REGEXP_REPLACE(LOWER('30
Try this:
SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'),
'(\d)(st|nd|rd|th)', '\1', 'g');
Note that matching a number is \d not /D: backslash, not forward
slash, and lowercase d not uppercase. \d means a digit, \D means
anything except a digit.
Also, I don't think Postgres supports posit
Hi list,
I'm stumped.
I am trying to use Regexp_Replace to replace ordinal suffixes in addresses (eg
have '126th' want '126') for comparison purposes. So far no luck.
I have found that
SELECT REGEXP_REPLACE(LOWER('300 North 126th Street'), '(?!/D)(st|nd|rd|th)',
'', 'g');
regexp_replace
-
18 matches
Mail list logo