Repository navigation
Commit 99b87ad
committed
Prepare the ICU regex translator for the REGEXP functions
The REGEXP functions need more from the translator than a text pattern:
- Match bytes, for binary strings. Classes and word boundaries are the
ones of PCRE, and a line ends at LF, VT, FF, and CR, like in MySQL.
- Accept a look-behind only when it holds characters, sets, and "|".
Older PCRE versions reject other look-behinds, so the same patterns
now work with every version.
- Raise WP_ICU_Regex_Exception with the MySQL error number 3690, and
name the rejected syntax in the message, like "(?x" or "\10".
- Write a NUL byte after a backslash as "\x00". PHP before 8.2 rejects
a NUL byte in a pattern.1 parent a1f8584 commit 99b87ad
4 files changed
Lines changed: 507 additions & 211 deletions
File tree
- packages/mysql-on-sqlite
- src
- icu
- tests/icu
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments