MCPcopy Create free account
hub / github.com/NetHack/NetHack / regex_compile

Function regex_compile

sys/share/cppregex.cpp:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34boolean
35regex_compile(const char *s, struct nhregex *re)
36{
37 if (!re)
38 return FALSE;
39 try {
40 re->re.reset(new std::regex(s, (std::regex::extended
41 | std::regex::nosubs
42 | std::regex::optimize)));
43 re->err.reset(nullptr);
44 return TRUE;
45 } catch (const std::regex_error& err) {
46 re->err.reset(new std::regex_error(err));
47 re->re.reset(nullptr);
48 return FALSE;
49 }
50}
51
52char *
53regex_error_desc(struct nhregex *re, char *errbuf)

Callers 5

msgtype_addFunction · 0.50
test_regex_patternFunction · 0.50
add_autopickup_exceptionFunction · 0.50
add_menu_coloring_parsedFunction · 0.50
add_sound_mappingFunction · 0.50

Calls

no outgoing calls

Tested by 1

test_regex_patternFunction · 0.40