git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45015
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// len may be the length of text (ignored by most system regex libs)
//
// may only be called after successful call to Compile()
// len may be the length of text (ignored by most system regex libs)
//
// may only be called after successful call to Compile()
- bool Matches(const wxChar *text, int flags = 0) const;
- bool Matches(const wxChar *text, int flags, size_t len) const;
- bool Matches(const wxString& text, int flags = 0) const
- { return Matches(text.c_str(), flags, text.length()); }
+ bool Matches(const wxString& text, int flags = 0) const;
+ bool Matches(const wxChar *text, int flags, size_t len) const
+ { return Matches(wxString(text, len), flags); }
// get the start index and the length of the match of the expression
// (index 0) or a bracketed subexpression (index != 0)
// get the start index and the length of the match of the expression
// (index 0) or a bracketed subexpression (index != 0)
-bool wxRegEx::Matches(const wxChar *str, int flags, size_t len) const
+bool wxRegEx::Matches(const wxString& str, int flags) const
{
wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
{
wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
- return m_impl->Matches(WXREGEX_CHAR(str), flags WXREGEX_IF_NEED_LEN(len));
-}
-
-bool wxRegEx::Matches(const wxChar *str, int flags) const
-{
- wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
-
- return m_impl->Matches(WXREGEX_CHAR(str),
- flags
- WXREGEX_IF_NEED_LEN(wxStrlen(str)));
+ return m_impl->Matches(WXREGEX_CHAR(str), flags
+ WXREGEX_IF_NEED_LEN(str.length()));
}
bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const
}
bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const