Skip to content

Commit 8058d95

Browse files
committed
n option parsed, not respected yet
1 parent 103a119 commit 8058d95

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Peachpie.Library.RegularExpressions/RegexOptions.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ public enum RegexOptions
5050
/// </summary>
5151
PCRE2_DUPNAMES = 0x10000, // J
5252

53+
/// <summary>
54+
/// Disables the use of numbered capturing parentheses in the pattern.
55+
/// </summary>
56+
PCRE2_NO_AUTO_CAPTURE = 0x20000, // n
57+
5358
///// <summary>
5459
///// Evaluate as PHP code.
5560
///// Deprecated and removed.
5661
///// </summary>
57-
//PREG_REPLACE_EVAL = 0x10000, // e
62+
//PREG_REPLACE_EVAL = 0x40000, // e
5863

5964
//
6065
// PCRE options for newline handling

src/Peachpie.Library.RegularExpressions/RegexParser.cs

+3
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,9 @@ public static RegexOptions PcreOptionFromCode(char option, int offset)
22132213
case 'x': // PCRE_EXTENDED
22142214
return RegexOptions.PCRE_EXTENDED;
22152215

2216+
case 'n': // PCRE_NO_AUTO_CAPTURE
2217+
return RegexOptions.PCRE2_NO_AUTO_CAPTURE;
2218+
22162219
case 'e': // PREG_REPLACE_EVAL // deprecated as of PHP 7.0
22172220
//return RegexOptions.PREG_REPLACE_EVAL;
22182221
return 0;

0 commit comments

Comments
 (0)