MCPcopy Create free account
hub / github.com/Samsung/UTopia / regex

Function regex

lib/utils/StringUtil.cpp:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace util {
14
15std::string regex(std::string str, std::string regexStr, unsigned group) {
16 try {
17 std::regex re(regexStr);
18 std::smatch match;
19 if (std::regex_match(str, match, re)) {
20 assert(group < match.size() && "Out of regex group size!");
21 return match[group].str();
22 } else {
23 return "";
24 }
25 } catch (std::regex_error &e) {
26 std::cout << "regex Exception : " << e.code() << std::endl;
27 assert("Can't use regex class");
28 }
29 return "";
30}
31
32std::string demangle(const char *name) {
33 int status = -1;

Callers 8

isDeprecatedLibraryMethod · 0.85
getRelativePathFunction · 0.85
isCallReturnMethod · 0.85
handleUserMethod · 0.85
TESTFunction · 0.85
getAvasFuzzVarTypeFunction · 0.85
changeStaticArrayToPtrFunction · 0.85
createRegexScrubberFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by 2

TESTFunction · 0.68
createRegexScrubberFunction · 0.68