From ef005d4f64d2ee2b35185d4fbdf2aea684cd4966 Mon Sep 17 00:00:00 2001 From: Lee Zher Huei Date: Fri, 24 Jul 2015 01:18:46 +0100 Subject: Regex library Nrex initial port --- bin/tests/test_string.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/tests/test_string.cpp b/bin/tests/test_string.cpp index 3c8d0f7d86..7b512a5d99 100644 --- a/bin/tests/test_string.cpp +++ b/bin/tests/test_string.cpp @@ -31,7 +31,7 @@ //#include "math_funcs.h" #include #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 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::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