From 47d5b304235c5b1f409b01cab95a2191eac5a230 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 18 Jul 2020 12:34:52 +0300 Subject: Add $regex.find_match() and $regex.find_search() functions --- tests/function/regex/testscript | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'tests/function/regex') diff --git a/tests/function/regex/testscript b/tests/function/regex/testscript index 95dfbb8..5167390 100644 --- a/tests/function/regex/testscript +++ b/tests/function/regex/testscript @@ -436,6 +436,90 @@ EOI } +: find-match +: +{ + : match + : + { + : string + : + $* <'true' + print $regex.find_match(-g -O3, [string] '-O[23]') + EOI + + : untyped + : + $* <'true' + print $regex.find_match(-g -O3, '-O[23]') + EOI + + : strings + : + $* <'true' + print $regex.find_match([strings] -g -O3, '-O[23]') + EOI + + : nomatch + : + $* <'false' + print $regex.find_match(-g -O1, '-O[23]') + EOI + } + + : flags + : + { + : icase + : + $* <'true' + print $regex.find_match(Foo.cxx, 'f[^.]+.*', icase) + EOI + } +} + +: find-search +: +{ + : match + : + { + : string + : + $* <'true' + print $regex.find_search(-g -O3, [string] '-O') + EOI + + : untyped + : + $* <'true' + print $regex.find_search(-g -O3, '-O') + EOI + + : strings + : + $* <'true' + print $regex.find_search([strings] -g -O3, '-O') + EOI + + : nomatch + : + $* <'false' + print $regex.find_search(-g, '-O') + EOI + } + + : flags + : + { + : icase + : + $* <'true' + print $regex.find_search(Foo.cxx, 'f', icase) + EOI + } +} + : merge : { -- cgit v1.1