Haxe bindings for koreader
リビジョン | 32cd55dc7cb62943fe91223a5649c3b60bd824c6 (tree) |
---|---|
日時 | 2022-03-02 06:31:56 |
作者 | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...> |
コミッター | Jaime Marquínez Ferrándiz |
Add regex test
@@ -74,6 +74,10 @@ | ||
74 | 74 | }, |
75 | 75 | }), |
76 | 76 | Button.create({ |
77 | + text: "Check regex", | |
78 | + callback: displayRegexTest, | |
79 | + }), | |
80 | + Button.create({ | |
77 | 81 | text: "Close", |
78 | 82 | callback: function close() { |
79 | 83 | UIManager.close(mainWindow, Partial); |
@@ -127,4 +131,13 @@ | ||
127 | 131 | var message = InfoMessage.create({text: "Accepted\n" + response}); |
128 | 132 | UIManager.show(message); |
129 | 133 | } |
134 | + | |
135 | + public static function displayRegexTest() { | |
136 | + // TODO: show input box | |
137 | + var reg = ~/world/i; | |
138 | + var match = reg.match('HELLO WORLD'); | |
139 | + var text = match ? "Matched" : "Unmatched"; | |
140 | + var message = InfoMessage.create({text: "Regex result:\n" + text}); | |
141 | + UIManager.show(message); | |
142 | + } | |
130 | 143 | } |
\ No newline at end of file |