Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
`
[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\([ \t\n]*\"[^\"]*\"[ \t\n]*(,[ \t\n]*\"[^\"]*\")?(,[ \t\n]*[^,\)]*)*\)+[ \t\n]*\{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*
`
gm
Input 1
New
// TEST_CASE( test name [, tags ] ) TEST_CASE("test name") { } TEST_CASE("test name", "[tag]") { } # SCENARIO( scenario name [, tags ] ) SCENARIO("test name") { } SCENARIO("test name", "[tag]") { } // Type parametrised test cases // TEMPLATE_TEST_CASE( test name , tags, type1, type2, ..., typen ) TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", int, std::string, (std::tuple<int,float>) ) { } // TEMPLATE_PRODUCT_TEST_CASE( test name , tags, (template-type1, template-type2, ..., template-typen), (template-arg1, template-arg2, ..., template-argm) ) TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) { } // TEMPLATE_LIST_TEST_CASE( test name, tags, type list ) TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes) { } // Signature based parametrised test cases // TEMPLATE_TEST_CASE_SIG( test name , tags, signature, type1, type2, ..
Extraction
// TEST_CASE( test name [, tags ] ) TEST_CASE("test name") { } TEST_CASE("test name", "[tag]") { } # SCENARIO( scenario name [, tags ] ) SCENARIO("test name") { } SCENARIO("test name", "[tag]") { } // Type parametrised test cases // TEMPLATE_TEST_CASE( test name , tags, type1, type2, ..., typen ) TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", int, std::string, (std::tuple<int,float>) ) { } // TEMPLATE_PRODUCT_TEST_CASE( test name , tags, (template-type1, template-type2, ..., template-typen), (template-arg1, template-arg2, ..., template-argm) ) TEMPLATE_PRODUCT_TEST_CASE("A Template product test case", "[template][product]", (std::vector, Foo), (int, float)) { } // TEMPLATE_LIST_TEST_CASE( test name, tags, type list ) TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes) { } // Signature based parametrised test cases // TEMPLATE_TEST_CASE_SIG( test name , tags, signature, type1, type2, ..