Skip to content

mbregex missing documentation about supported RE syntax #2024

Open
@dashiad

Description

@dashiad

Description

The following code:

<?php
mb_ereg_search_init("qaaoiuu");
mb_ereg_search_setpos(1);
var_dump(mb_ereg_search_pos("^a{2}(..)u{2}"));

Resulted in this output:

bool(false)

But I expected this output instead:

array(2) {
  [0]=>
  int(1)
  [1]=>
  int(6)
}

The "^" modifier is not applying to the start of the whole string either (independently of "setpos"), as :

<?php
mb_ereg_search_init("aaoiuu");
mb_ereg_search_setpos(1);
var_dump(mb_ereg_search_pos("^a{2}(..)u{2}"));

Returns false too (this should be expected).

bool(false)

Does "^" have a different meaning in the mb_ereg_search functions?

PHP Version

PHP 8.1.12 and previous versions

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Extension: mbstringbugDocumentation contains incorrect information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions