21 #include <cppunit/TestFixture.h>    22 #include <cppunit/extensions/HelperMacros.h>    35   CPPUNIT_TEST (regTest);
    37   CPPUNIT_TEST_SUITE_END ();
    51     std::string content = 
"This is copy of a copyright statement similar to copyleft found in copying";
    52     rx::regex matchingRegex (
"copy");
    54     std::string::const_iterator begin = content.begin();
    55     std::string::const_iterator end = content.end();
    56     rx::match_results<std::string::const_iterator> what;
    59     while (rx::regex_search(begin, end, what,matchingRegex)) {
    61       begin = what[0].second;
    64     CPPUNIT_ASSERT_EQUAL (4, nfound);
    71 CPPUNIT_TEST_SUITE_REGISTRATION( 
regexTest );
 void regTest(void)
Test regex on a test string. 
 
Test fixture to test regex accuracy.