+#ifdef wxUSE_RNWXRE
+ wxRe Re;
+ wxRe::wxReError e;
+ if ((e = Re.Comp(szPattern, nCompileFlags2)) != wxRe::wxRE_OK)
+ szStatus2 = wxString::Format(_("\nCompile Failed!\n%s\n"), wxRe::ErrorToString(e));
+ else
+ {
+ //Here's where we actually search our string
+ if ((e = Re.Exec(szSearch, nMatchFlags2)) != wxRe::wxRE_OK)
+ szStatus2 = wxString::Format(_("\nExecution/Matching Failed!\n%s\n"), wxRe::ErrorToString(e));
+ else
+ {
+ dwStartIndex2 = Re.GetMatch(0).first;
+ dwEndIndex2 = Re.GetMatch(0).second;
+
+ szStatus2 = _("Success");
+
+ dwStartTime2 = clock();
+
+ if (OptionsMenu->IsChecked(CompID))
+ {
+ for(i = 0; i < n; ++i)
+ {
+ Re.Comp(szPattern, nCompileFlags2);
+ Re.Exec(szSearch, nMatchFlags2);
+ }
+ }
+ else
+ {
+ for(i = 0; i < n; ++i)
+ {
+ Re.Exec(szSearch, nMatchFlags2);
+ }
+ }
+
+ dwEndTime2 = clock() - dwStartTime2;
+ }
+ }
+ szResult2 = wxString::Format(
+ _("--wxRe--\nIndex:[%i]-[%i]\nString:%s\nMatch Time:%ums\nStatus:%s"),
+ dwStartIndex2, dwEndIndex2+dwStartIndex2,
+ szSearch.Mid(dwStartIndex2, dwEndIndex2),
+ dwEndTime2,
+ szStatus2
+ );
+#endif //wxUSE_RNWXRE
+
+#ifdef wxUSE_GRETA
+ std::string stdszPattern(szPattern);
+ rpattern Greta (stdszPattern,GLOBAL,MODE_MIXED);
+ match_results r;
+ std::string stdszSearch(szSearch);
+
+ //Here's where we actually search our string
+ if (!Greta.match(stdszSearch, r).matched)
+ szStatus3 += _("\nExecution/Matching Failed!\n");
+ else
+ {
+ szStatus3 = _("Success");
+
+ dwStartTime3 = clock();
+
+ if (OptionsMenu->IsChecked(CompID))
+ {
+ for(i = 0; i < n; ++i)
+ {
+ Greta = rpattern(stdszPattern,GLOBAL,MODE_MIXED);
+ Greta.match(stdszSearch, r);
+ }
+ }
+ else
+ {
+ for(i = 0; i < n; ++i)
+ {
+ Greta.match(stdszSearch, r);
+ }
+ }
+
+ dwEndTime3 = clock() - dwStartTime3;
+ }
+
+ szResult3 = wxString::Format(
+ _("--Greta--\nIndex:[%i]-[%i]\nString:%s\nMatch Time:%ums\nStatus:%s"),
+ r.rstart(), r.rlength() + r.rstart(),
+ szSearch.Mid(r.rstart(), r.rlength()),
+ dwEndTime3,
+ szStatus3);
+#endif //wxUSE_GRETA
+
+#ifdef wxUSE_PCRE
+ pcre* pPcre;
+ const wxChar* szError;
+ int nErrOff;
+
+ if ((pPcre = pcre_compile(szPattern, nCompileFlags4, &szError, &nErrOff, 0)) == NULL)
+ szStatus4 = wxString::Format(_("\nCompile Failed!\nError:%s\nOffset:%i\n"), szError, nErrOff);
+ else
+ {
+ size_t msize;
+ pcre_fullinfo(pPcre, 0, PCRE_INFO_CAPTURECOUNT, &msize);
+ msize = 3*(msize+1);
+ int *m = new int[msize];
+
+ //Here's where we actually search our string
+ if (!pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize))
+ szStatus4 = wxString::Format(_("\nExecution/Matching Failed!\n"));
+ else
+ {
+ dwStartIndex4 = m[0];
+ dwEndIndex4 = m[1] - m[0];
+
+ szStatus4 = _("Success");
+
+ dwStartTime4 = clock();
+
+ if (OptionsMenu->IsChecked(CompID))
+ {
+ for(i = 0; i < n; ++i)
+ {
+ pPcre = pcre_compile(szPattern, nCompileFlags4, &szError, &nErrOff, 0);
+ pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize);
+ }
+ }
+ else
+ {
+ for(i = 0; i < n; ++i)
+ {
+ pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize);
+ }
+ }
+
+ dwEndTime4 = clock() - dwStartTime4;
+ }
+ }
+ szResult4 = wxString::Format(
+ _("--PCRE--\nIndex:[%i]-[%i]\nString:%s\nMatch Time:%ums\nStatus:%s"),
+ dwStartIndex4, dwEndIndex4+dwStartIndex4,
+ szSearch.Mid(dwStartIndex4, dwEndIndex4),
+ dwEndTime4,
+ szStatus4
+ );
+#endif //wxUSE_PCRE
+
+ ResultText.SetLabel(szResult + _("\n\n") + szResult2);
+ ResultText2.SetLabel(szResult3 + _("\n\n") + szResult4);