MCPcopy Create free account
hub / github.com/cucumber/cucumber-cpp / escapeRegex

Method escapeRegex

src/CukeCommands.cpp:52–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52const std::string CukeCommands::escapeRegex(const std::string reg) const {
53 return regex_replace(
54 reg,
55 std::regex("[\\|\\(\\)\\[\\]\\{\\}\\^\\$\\*\\+\\?\\.\\\\]"),
56 "\\\\&",
57 std::regex_constants::match_default | std::regex_constants::format_sed
58 );
59}
60
61const std::string CukeCommands::escapeCString(const std::string str) const {
62 return regex_replace(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected