Can Postgres beat Oracle for regexp_count?

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Can Postgres beat Oracle for regexp_count?
Date: 2022-02-02 20:20:31
Message-ID: CA+i5JwaC87tdr4s=mzkBqPOrqp+sPHVEA+HmwRX0hh1ZBUNKkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It has been found that regexp_count works brilliantly in Oracle.

However, it is not easy to replicate that in Postgres. The following codes
have been experimented but without any luck.

select regexp_matches('My High Street', '([A-Z][a-z]+[\s])', 'g')

select regexp_matches('My High Street', '([A-Z][a-z]+[\s]*)', 'g')

County occurrences of 'My High Street' in one of the following strings:

'My High Street' 1
'' 0
'My High Street My High Street' 2

Can anyone enlighten all of us?

Regards,

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-02-02 20:43:15 Re: Can Postgres beat Oracle for regexp_count?
Previous Message Michael Lewis 2022-02-02 19:46:39 Re: increasing effective_cache_size slows down join queries by a factor of 4000x