BUG #18956: Observing an issue in regexp_count()

PG Bug reporting form <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: anudeepvattikonda0404@gmail.com
Date: 2025-06-12T08:03:25Z
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18956
Logged by:          Anudeep Vattikonda
Email address:      anudeepvattikonda0404@gmail.com
PostgreSQL version: 17.5
Operating system:   Mac
Description:        

Hi
I am trying to run the below query
select REGEXP_COUNT('cat at the flat', '\Bat\b') ;
I was expecting it to return 2 but I see Postgres is returning 0. I see that
there are two matches, cat and flat. All it should do is to look for the
word at whose left side shoudn't be a word boundary while the right side
should be a word boundary
Thank you