Skip to content

Commit c17c0cf

Browse files
committed
Add a lightweight ICU to PCRE regex translator
MySQL reads REGEXP patterns with ICU, and the driver runs them with PCRE. The two differ in sets, escapes, line ends, word characters, and POSIX classes. WP_ICU_Regex_Translator splits a pattern into tokens with one regex. A token either means the same in PCRE, or it has a translation. Any other text is rejected, so PCRE-only syntax, like "(?R)" or "\K", and ICU syntax that isn't supported, like set operations or the "x" flag, never reach PCRE. The REGEXP functions don't use the class yet.
1 parent 2300409 commit c17c0cf

3 files changed

Lines changed: 1394 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)