template<>
class seqan3::regex_validator< std::string >
A validator that checks if a matches a regular expression pattern.
On construction, the validator must receive a pattern for a regular expression. The pattern variable will be used for constructing an std::regex and the validator will call std::regex_match on the command line argument. Note: A regex_match will only return true if the strings matches the pattern completely (in contrast to regex_search which also matches substrings). The struct than acts as a functor, that throws a seqan3::parser_invalid_argument exception whenever a given filename (string) is not in the given extension list.
int main(int argc, const char ** argv)
{
std::string my_string;
seqan3::regex_validator my_validator{"[a-zA-Z]+@[a-zA-Z]+\\.com"};
myparser.add_option(my_string,'s',"str","Give me a string.",
try
{
myparser.parse();
}
{
std::cerr << "[PARSER ERROR] " << ext.what() << "\n";
return -1;
}
{
return 0;
}
return 0;
}