1 #ifndef REGEX_FILTER_H_
2 #define REGEX_FILTER_H_
4 #include "graph_filter.h"
22 template<
typename GraphType>
25 std::string regex_pattern_;
33 regex_pattern_ = pattern;
36 RegexFilter( std::string filter_name, std::string pattern ) :
38 regex_pattern_ = pattern;
49 return !this->inverted_;
61 if(regcomp(&re, regex_pattern_.c_str(), REG_EXTENDED) != 0) {
62 regcomp(&re,
"", REG_EXTENDED);
66 status = regexec(&re, m->
name().c_str(), 0, 0, 0);
69 if (status != 0 && !this->inverted_) {
71 }
else if(status == 0 && this->inverted_) {
79 template<
typename P1,
typename P2>
84 std::string pattern() {
85 return regex_pattern_;
Definition: regex_filter.h:23
virtual bool operator()(E_type edge)
Ignores edges - no action.
Definition: regex_filter.h:48
Forward declarations for functors.
Definition: defines.h:32
std::string name() const
Accessor for name.
Definition: swu.cc:151
Definition: graph_filter.h:15
virtual GraphFilter< GraphType > * clone()
Clone operation.
Definition: regex_filter.h:42