Add support for PCRE n modifier

Add support for /n (NO_AUTO_CAPTURE) modifier, which makes simple
`(xyz)` groups non-capturing.

Closes GH-7583.
This commit is contained in:
Felipe Pena 2021-10-15 12:03:26 -03:00 committed by Nikita Popov
parent 90b7bde615
commit e089a50f53
3 changed files with 33 additions and 0 deletions

View file

@ -734,6 +734,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
/* Perl compatible options */
case 'i': coptions |= PCRE2_CASELESS; break;
case 'm': coptions |= PCRE2_MULTILINE; break;
case 'n': coptions |= PCRE2_NO_AUTO_CAPTURE; break;
case 's': coptions |= PCRE2_DOTALL; break;
case 'x': coptions |= PCRE2_EXTENDED; break;