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

Function jjRegexMatch

Sources/Jazz2/Scripting/JJ2PlusDefinitions.cpp:2227–2241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225 }
2226 }
2227 bool jjRegexMatch(const String& text, const String& expression, bool ignoreCase) {
2228 noop();
2229
2230 try {
2231 auto flags = std::regex_constants::ECMAScript;
2232 if (ignoreCase) {
2233 flags |= std::regex_constants::icase;
2234 }
2235 std::regex r(expression.begin(), expression.end(), flags);
2236 return std::regex_match(text.begin(), text.end(), r);
2237 } catch (std::regex_error& e) {
2238 LOGE("Failed to process regular expression: {}", e.what());
2239 return false;
2240 }
2241 }
2242 bool jjRegexMatchWithResults(const String& text, const String& expression, CScriptArray& results, bool ignoreCase) {
2243 noop();
2244

Callers

nothing calls this directly

Calls 3

whatMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected