MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / Email

Class Email

sample/Extractor-Pattern.cpp:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31struct Email
32{
33 constexpr std::optional<std::array<std::string_view, 2>>
34 operator()(std::string_view sv) const
35 {
36 auto const d = sv.find("@");
37 if (d == std::string_view::npos)
38 {
39 return {};
40 }
41 return std::array<std::string_view, 2>{sv.substr(0, d), sv.substr(d + 1)};
42 }
43};
44
45inline constexpr Email email;
46

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected