-#endif //wxUSE_WXREGEX
-
-#ifdef wxUSE_RNWXRE
- SetStatusText("Testing 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(_("\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)
- {
- SetStatusText(wxString::Format(_("RNWXRE Compile #%i"), i));
- Re.Comp(szPattern, nCompileFlags2);
- }
- }
- if (OptionsMenu->IsChecked(MatchID))
- {
- for(i = 0; i < n; ++i)
- {
- SetStatusText(wxString::Format(_("RNWXRE Match #%i"), i));
- Re.Exec(szSearch, nMatchFlags2);
- }
- }
-
- dwEndTime2 = clock() - dwStartTime2;
- }
- }
- szResult2 = wxString::Format(
- _("--Ryan's 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
- SetStatusText("Testing GRETA...");
- bool bSuccess = true;
-
- std::string stdszPattern(szPattern);
- rpattern Greta;
- try
- {
- Greta = rpattern(stdszPattern,EXTENDED,MODE_MIXED);
- }
- catch (...)
- {
- bSuccess = false;
- szStatus3 += _("\nCompile Failed!\n");
- }
- match_results r;
- std::string stdszSearch(szSearch);
-
- if(bSuccess)
- {
- //Here's where we actually search our string
- if (!(bSuccess = 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)
- {
- //Supposively GRETA doesn't compile, but
- //it's clear that it slows performance greatly
- //when creating a rpattern object,
- //so one can only surmize that it performs
- //some kind of optimizations in the constructor
- Greta = rpattern(stdszPattern,EXTENDED,MODE_MIXED);
- SetStatusText(wxString::Format(_("GRETA Compile #%i"), i));
- }
- }
- if (OptionsMenu->IsChecked(MatchID))
- {
- for(i = 0; i < n; ++i)
- {
- Greta.match(stdszSearch, r);
- SetStatusText(wxString::Format(_("GRETA Match #%i"), i));
- }
- }
-
- dwEndTime3 = clock() - dwStartTime3;
- }
- }
-
- if (bSuccess)
- {
- dwStartIndex3 = r.rstart();
- dwEndIndex3 = r.rlength();
- }
-
- szResult3 = wxString::Format(
- _("--Greta--\nIndex:[%i]-[%i]\nString:%s\nMatch Time:%ums\nStatus:%s"),
- dwStartIndex3, dwStartIndex3 + dwEndIndex3,
- szSearch.Mid(dwStartIndex3, dwEndIndex3),
- dwEndTime3,
- szStatus3);
-#endif //wxUSE_GRETA
-
-#ifdef wxUSE_PCRE
- SetStatusText("Testing 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
- pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize);
- if (m[0] == -1)
- 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);
- SetStatusText(wxString::Format(_("PCRE Compile #%i"), i));
- }
- }
- if (OptionsMenu->IsChecked(MatchID))
- {
- for(i = 0; i < n; ++i)
- {
- pcre_exec(pPcre, 0, szSearch, szSearch.Length(), 0, 0, m, msize);
- SetStatusText(wxString::Format(_("PCRE Match #%i"), i));
- }
- }
-
- 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
-