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 a 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 class than acts as a functor, that throws a seqan3::validation_error exception whenever string does not match the pattern.
int main(int argc, const char ** argv)
{
myparser.add_option(my_string,'s',"str","Give me a string.",
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
Meta-header for the Argument Parser module .
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition: exceptions.hpp:40
The SeqAn command line parser.
Definition: argument_parser.hpp:154
A validator that checks if a matches a regular expression pattern.
Definition: validators.hpp:923
Provides seqan3::debug_stream and related types.
@ standard
The default were no checking or special displaying is happening.
Definition: auxiliary.hpp:250
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:37