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

Function jjRegexReplace

Sources/Jazz2/Scripting/JJ2PlusDefinitions.cpp:2293–2309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2291 }
2292 }
2293 String jjRegexReplace(const String& text, const String& expression, const String& replacement, bool ignoreCase) {
2294 noop();
2295
2296 try {
2297 auto flags = std::regex_constants::ECMAScript;
2298 if (ignoreCase) {
2299 flags |= std::regex_constants::icase;
2300 }
2301 std::regex r(expression.begin(), expression.end(), flags);
2302 std::string textStr = text;
2303 std::string replacementStr = replacement;
2304 return std::regex_replace(textStr, r, replacementStr);
2305 } catch (std::regex_error& e) {
2306 LOGE("Failed to process regular expression: {}", e.what());
2307 return text;
2308 }
2309 }
2310
2311 std::int32_t GetFPS() {
2312 noop();

Callers

nothing calls this directly

Calls 3

whatMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected