Re: [GENERAL] Regular expression question with Postgres

2014-07-24 Thread Mike Christensen
Yea looks like Postgres has it right, well.. per POSIX standard anyway. JavaScript also has it right, as does Python and .NET. Ruby is just weird. On Thu, Jul 24, 2014 at 1:57 PM, Tom Lane wrote: > Mike Christensen writes: > > I'm curious why this query returns 0: > > SELECT 'AAA' ~ '^A{,4}$

Re: [GENERAL] Regular expression question with Postgres

2014-07-24 Thread Tom Lane
Mike Christensen writes: > I'm curious why this query returns 0: > SELECT 'AAA' ~ '^A{,4}$' > Yet, this query returns 1: > SELECT 'AAA' ~ '^A{0,4}$' > Is this a bug with the regular expression engine? Our regex documentation lists the following variants of bounds syntax: {m} {m,} {

Re: [GENERAL] Regular expression question with Postgres

2014-07-24 Thread Mike Christensen
Yea seems right. I was testing the expression on Rubular (Which uses the Ruby parser) and it worked. I guess Ruby allows this non-standard expression with the missing lower bounds. Every reference I could find, though, agrees only the upper bound is optional. On Thu, Jul 24, 2014 at 1:42 PM, D

Re: [GENERAL] Regular expression question with Postgres

2014-07-24 Thread David G Johnston
Mike Christensen-2 wrote > I'm curious why this query returns 0: > > SELECT 'AAA' ~ '^A{,4}$' > > Yet, this query returns 1: > > SELECT 'AAA' ~ '^A{0,4}$' > > Is this a bug with the regular expression engine? Apparently since "{,#}" is not a valid regexp expression the engine simply interprets

Re: [GENERAL] Regular Expression Question

2005-12-03 Thread Thomas Pundt
Hi, Am Saturday 03 December 2005 12:48 schrieb Terry Lee Tucker: | I have a situation where I need to extract a couple pieces of | information from a string. The string, if entered perfectly by the user, | would look someting like this: DUN: 006235835 SID: KT-3616* | | I need to extract the 006

Re: [GENERAL] Regular Expression Question

2005-12-03 Thread Karl O. Pinc
On 12/03/2005 05:48:59 AM, Terry Lee Tucker wrote: RE Gurus: I have a situation where I need to extract a couple pieces of information from a string. The string, if entered perfectly by the user, would look someting like this: DUN: 006235835 SID: KT-3616* I need to extract the 006235835 into

Re: [GENERAL] Regular expression question

2000-12-11 Thread Tom Lane
Steve Heaven <[EMAIL PROTECTED]> writes: > Does the regular expression parser have anything equivalent to Perl's \w > word boundary metacharacter? src/backend/regex/re_format.7 contains the whole scoop (for some reason this page doesn't seem to get installed with the rest of the documentation).

RE: [GENERAL] Regular expression question

2000-12-11 Thread Michael Ansley
Title: RE: [GENERAL] Regular expression question Yes, that's right :-0  Sorry! -Original Message- From: Steve Heaven [mailto:[EMAIL PROTECTED]] Sent: 11 December 2000 15:09 To: Michael Ansley; [EMAIL PROTECTED] Subject: RE: [GENERAL] Regular expression question At 14:58 11/