MCPcopy Create free account
hub / github.com/Extra-Creativity/Modern-Cpp-Basics / ReplaceTest

Function ReplaceTest

08-String & Stream/code/RegexTest.cpp:78–87  ·  view source on GitHub ↗

re2 only

Source from the content-addressed store, hash-verified

76
77// re2 only
78void ReplaceTest()
79{
80 std::string newString{ multiStr };
81 // 用第二个捕获(127)进行替换
82 if (RE2::Replace(&newString, re2Regex, "\\2"))
83 std::println("re2 Replace test: {}", newString);
84 newString = multiStr;
85 if (RE2::GlobalReplace(&newString, re2Regex, "SOME_IP\\2"))
86 std::println("re2 Global replace test: {}", newString);
87}
88
89// ctre only
90void TokenizeTest()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected