8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
18 module ALib.Strings.Search;
23#if ALIB_FEAT_BOOST_REGEX && ALIB_CHARACTERS_WIDE && !ALIB_CHARACTERS_NATIVE_WCHAR
24# pragma message ( "Warning: Class RegexMatcher will not be available, because ALIB_CHARACTERS_NATIVE_WCHAR is false." )
27#if ALIB_FEAT_BOOST_REGEX && (!ALIB_CHARACTERS_WIDE || ALIB_CHARACTERS_NATIVE_WCHAR)
32 if( pattern.IsNull() )
35 boostRegex.assign( std::basic_string<character>(pattern.Buffer(),
size_t( pattern.Length() ) ),
36 boost::regex_constants::optimize );
41 return boost::regex_match(haystack.begin(), haystack.end(),
boostRegex);
46 boost::match_results<
String::const_iterator> what;
47 if( boost::regex_search(haystack.begin(), haystack.end(), what,
boostRegex ) )
48 return { what.position(), what.
length(0) };
boost::basic_regex< character, boost::regex_traits< character > > boostRegex
This is the internal regex matcher.
ALIB_DLL SRange SearchIn(const String &haystack)
ALIB_DLL void Compile(const String &pattern)
RegexMatcher(const String &pattern=NULL_STRING)
ALIB_DLL bool Match(const String &haystack)
#define ALIB_ASSERT_ERROR(cond, domain,...)
strings::TString< character > String
Type alias in namespace alib.