// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "regex.h"
#endif
#include <sys/types.h>
#endif
+#ifndef __WXWINCE__
#include <regex.h>
+#endif
#include "wx/regex.h"
+#if wxUSE_UNICODE
+ #define regerror wx_regerror
+ #define regfree wx_regfree
+#endif
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
if ( flags & wxRE_NEWLINE )
flagsRE |= REG_NEWLINE;
+
// compile it
+#if wxUSE_UNICODE
+ int errorcode = wx_regcomp(&m_RegEx, expr, expr.Length(), flagsRE);
+#else
int errorcode = regcomp(&m_RegEx, expr.mb_str(), flagsRE);
- if ( errorcode )
+#endif
+
+ if ( errorcode )
{
wxLogError(_("Invalid regular expression '%s': %s"),
expr.c_str(), GetErrorMsg(errorcode).c_str());
}
// do match it
+#if wxUSE_UNICODE
+ rm_detail_t rd;
+ int rc = wx_regexec(&self->m_RegEx, str, wxStrlen(str), &rd, m_nMatches, m_Matches, flagsRE);
+#else
int rc = regexec(&self->m_RegEx, wxConvertWX2MB(str), m_nMatches, m_Matches, flagsRE);
+#endif
switch ( rc )
{