Re: Can Postgres beat Oracle for regexp_count? - Mailing list pgsql-general

From Tom Lane
Subject Re: Can Postgres beat Oracle for regexp_count?
Date
Msg-id 104523.1643840782@sss.pgh.pa.us
Whole thread Raw
In response to Re: Can Postgres beat Oracle for regexp_count?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Can Postgres beat Oracle for regexp_count?  (Shaozhong SHI <shishaozhong@gmail.com>)
Re: Can Postgres beat Oracle for regexp_count?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Given we don't have a regexp_count function this isn't surprising...

FYI, it's there in HEAD.

In the meantime, you could possibly do something like

=# select count(*) from regexp_matches('My High Street', '([A-Z][a-z]+[\s])', 'g');
 count
-------
     2
(1 row)

(Note that 2 is the correct answer given that there's no space
after the third word; I trust Oracle agrees.)

            regards, tom lane



pgsql-general by date:

Previous
From: Imre Samu
Date:
Subject: Re: increasing effective_cache_size slows down join queries by a factor of 4000x
Next
From: Tomas Vondra
Date:
Subject: Re: increasing effective_cache_size slows down join queries by a factor of 4000x