Add convenience API for searching std::string

This commit is contained in:
Allan Odgaard
2013-02-07 13:00:15 +01:00
parent 0ee796d7a7
commit a8f1c9ef06
2 changed files with 6 additions and 0 deletions

View File

@@ -124,6 +124,11 @@ namespace regexp
return match_t();
}
match_t search (pattern_t const& ptrn, std::string const& str)
{
return search(ptrn, str.data(), str.data() + str.size());
}
// =====================
// = Syntax validation =
// =====================

View File

@@ -76,6 +76,7 @@ namespace regexp
PUBLIC std::string validate (std::string const& ptrn);
PUBLIC match_t search (pattern_t const& ptrn, char const* first, char const* last, char const* from = NULL, char const* to = NULL, OnigOptionType options = ONIG_OPTION_NONE);
PUBLIC match_t search (pattern_t const& ptrn, std::string const& str);
} /* regexp */