1 /*******************************************************
2 * Unit test for the String class
4 * test regular expression operations
5 ******************************************************
14 // TODO: test regex coinstructors
16 // A simple regular expression
19 // Regular expression matching
21 String s2 = "abd123def";
23 std::cout << "Regular expression matching.\n";
24 assert((s1 == nr) == false);
25 assert((s2 == nr) == true);
27 // Select a substring with a regex
32 std::cout << "The matching part of \"" << s2 << "\" is \"" << match << "\"\n";
33 assert(match == "123");