1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Regex library Nrex initial port

This commit is contained in:
Lee Zher Huei
2015-07-24 01:18:46 +01:00
parent f697ec2fe0
commit ef005d4f64
17 changed files with 1254 additions and 1206 deletions

View File

@@ -31,7 +31,7 @@
//#include "math_funcs.h"
#include <stdio.h>
#include "os/os.h"
#include "drivers/trex/regex.h"
#include "drivers/nrex/regex.h"
#include "test_string.h"
@@ -463,20 +463,16 @@ bool test_26() {
OS::get_singleton()->print("\n\nTest 26: RegEx\n");
RegEx regexp("(.*):(.*)");
List<String> captures;
bool match = regexp.match("name:password", &captures);
printf("\tmatch: %s\n", match?"true":"false");
bool res = regexp.match("name:password");
printf("\tmatch: %s\n", res?"true":"false");
printf("\t%i captures:\n", captures.size());
List<String>::Element *I = captures.front();
while (I) {
printf("%ls\n", I->get().c_str());
I = I->next();
};
return captures.size();
printf("\t%i captures:\n", regexp.get_capture_count());
for (int i = 0; i<regexp.get_capture_count(); i++)
{
printf("%ls\n", regexp.get_capture(i).c_str());
}
return res;
};
struct test_27_data {