MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / jjRegexSearch

Function jjRegexSearch

Sources/Jazz2/Scripting/JJ2PlusDefinitions.cpp:2260–2274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2258 }
2259 }
2260 bool jjRegexSearch(const String& text, const String& expression, bool ignoreCase) {
2261 noop();
2262
2263 try {
2264 auto flags = std::regex_constants::ECMAScript;
2265 if (ignoreCase) {
2266 flags |= std::regex_constants::icase;
2267 }
2268 std::regex r(expression.begin(), expression.end(), flags);
2269 return std::regex_search(text.begin(), text.end(), r);
2270 } catch (std::regex_error& e) {
2271 LOGE("Failed to process regular expression: {}", e.what());
2272 return false;
2273 }
2274 }
2275 bool jjRegexSearchWithResults(const String& text, const String& expression, CScriptArray& results, bool ignoreCase) {
2276 noop();
2277

Callers

nothing calls this directly

Calls 3

whatMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected