BUG #17761: Questionable regular expression behavior

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kosiodg(at)yahoo(dot)com
Subject: BUG #17761: Questionable regular expression behavior
Date: 2023-01-27 09:27:35
Message-ID: 17761-5a78c34533f3ab72@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17761
Logged by: Konstantin Geordzhev
Email address: kosiodg(at)yahoo(dot)com
PostgreSQL version: 11.10
Operating system: tested online
Description:

Executing:
select regexp_matches('a 1x1250x2500',
'(a).*?([1-9]\d*)\s*x\s*([1-9]\d*)(?:\s*x\s*([1-9]\d*))?');
returns: {a,1,1,NULL}
while executing:
select regexp_matches('a 1x1250x2500',
'(a|b).*?([1-9]\d*)\s*x\s*([1-9]\d*)(?:\s*x\s*([1-9]\d*))?');
returns: {a,1,1250,2500}

Shouldn't both results be equal?

Tested online at:
https://extendsclass.com/postgresql-online.html
and on ubuntu version 9.5

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-01-27 12:21:11 BUG #17762: date field casts to null in case section with join's
Previous Message Tom Lane 2023-01-26 16:06:41 Re: FW: Query execution failure