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
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=#
George Weaver gwea...@shaw.ca 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.
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();
On Mar 1, 2014, at 11:45 AM, George Weaver gwea...@shaw.ca 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
- Original Message -
From: Steve Atkins
snip
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
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
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
On Feb 28, 2014, at 2:04 PM, George Weaver gwea...@shaw.ca 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
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 gwea...@shaw.ca wrote:
Hi list,
I'm stumped.
I am trying to use Regexp_Replace to replace ordinal suffixes in addresses
(eg have '126th'
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
From: Steve Atkins
On Feb 28, 2014, at 2:04 PM, George Weaver gwea...@shaw.ca 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
On Feb 28, 2014, at 2:43 PM, George Weaver gwea...@shaw.ca 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',
- Original Message -
From: Steve Atkins
On Feb 28, 2014, at 2:43 PM, George Weaver gwea...@shaw.ca 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
- 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 gwea...@shaw.ca wrote:
Hi list,
I'm stumped.
I am trying to use Regexp_Replace to replace
2014-03-01 8:16 GMT+09:00 George Weaver gwea...@shaw.ca:
- Original Message - From: Steve Atkins
On Feb 28, 2014, at 2:43 PM, George Weaver gwea...@shaw.ca wrote:
Maybe this?
select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
'\1', 'gi');
Hi Steve,
From: Ian Lawrence Barwick
- Original Message - From: Steve Atkins
On Feb 28, 2014, at 2:43 PM, George Weaver gwea...@shaw.ca wrote:
Maybe this?
select regexp_replace('300 North 126th Street', '(\d+)(?:st|nd|rd|th)',
'\1', 'gi');
Hi Steve,
Thanks, but no luck:
select
GW == George Weaver gwea...@shaw.ca 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:
18 matches
Mail list logo