Skip to content

REGEXP_COUNT returns wrong value #1481

Closed

Description

@hanjianqiao

Bug Report

REGEXP_COUNT returns wrong value

Using IvorySQL master, Oracle compatible mode:

[ORA]postgres=# SELECT REGEXP_COUNT('bX' || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  2
(1 row)

[ORA]postgres=# SELECT REGEXP_COUNT(chr(10) || 'bX' || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  1
(1 row)

[ORA]postgres=# SELECT REGEXP_COUNT(chr(10) || 'bX' || chr(10) || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  0
(1 row)

Using Oracle 19c:

SELECT REGEXP_COUNT('bX' || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  2
(1 row)

SELECT REGEXP_COUNT(chr(10) || 'bX' || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  2
(1 row)

SELECT REGEXP_COUNT(chr(10) || 'bX' || chr(10) || 'cX', '.X', 1, 'c') AS r2 from dual;
 r2 
----
  2
(1 row)

Activity

  1. added
    bug
    on Jul 30, 2026
  2. ai-yang commented on Jul 31, 2026

    @ai-yang
    Contributor

    /assign

  3. faweizhao26 commented on Aug 18, 2026

    @faweizhao26
    Collaborator

    /assign

    Thanks for your contribution. Please submit this form and we will send you the swags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions