1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-09-28 14:30:51 +00:00

Luaj: Support PCRE character definitions for Luaj Regex [#502]

This commit is contained in:
gnosygnu 2019-07-01 14:09:31 -04:00
parent 5055f82d21
commit b65fda764f
3 changed files with 8 additions and 3 deletions

View File

@ -47,6 +47,11 @@ public class Scrib_lib_ustring__match__tst {
@Test public void Balanced__numbered_2() {
Exec_match("A88B[[5]]X99Y", "A(%d)%1B%b[]X(%d)%2Y", 1, "8;9");
}
@Test public void Unicode_alpha() {// ISSUE#:502; DATE:2019-07-01
Exec_match("ä" , "%a", 1, "ä");
}
// @Test public void Match_viwiktionary() {
// fxt.Init_cbk(Scrib_core.Key_mw_interface, fxt.Core().Lib_ustring(), Scrib_lib_ustring.Invk_match);
// Exec_match("tr" , "()(r)", 1, ";"); // should return all matches

View File

@ -306,7 +306,7 @@ class Lua_cls_matcher {
Init_itm(Bool_.Y, "s", "\\s"); // JAVA: \p{Xps} not valid; REF: https://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
Init_itm(Bool_.Y, "u", "\\p{Lu}");
Init_itm(Bool_.Y, "w", regx_w);
Init_itm(Bool_.Y, "x", "[0-9A-Fa-f0-9A-Fa-f]");
Init_itm(Bool_.Y, "x", "[0-9A-Fa-f---]");
Init_itm(Bool_.Y, "z", "\\x00");
Init_itm(Bool_.Y, "A", "\\P{L}");
@ -317,11 +317,11 @@ class Lua_cls_matcher {
Init_itm(Bool_.Y, "S", "\\S"); // JAVA: \P{Xps} not valid
Init_itm(Bool_.Y, "U", "\\P{Lu}");
Init_itm(Bool_.Y, "W", regx_W);
Init_itm(Bool_.Y, "X", "[^0-9A-Fa-f0-9A-Fa-f]");
Init_itm(Bool_.Y, "X", "[^0-9A-Fa-f---]");
Init_itm(Bool_.Y, "Z", "[^\\x00]");
Init_itm(Bool_.N, "w", regx_w);
Init_itm(Bool_.N, "x", "0-9A-Fa-f0-9A-Fa-f");
Init_itm(Bool_.N, "x", "0-9A-Fa-f---");
Init_itm(Bool_.N, "W", regx_W);
Init_itm(Bool_.N, "X", "\\x00-\\x2f\\x3a-\\x40\\x47-\\x60\\x67-\\x{ff0f}\\x{ff1a}-\\x{ff20}\\x{ff27}-\\x{ff40}\\x{ff47}-\\x{10ffff}");
Init_itm(Bool_.N, "Z", "\\x01-\\x{10ffff}");

Binary file not shown.