37#include    <cppthread/log.h> 
   42#include    <snapdev/poison.h> 
   63        validator::register_validator(*
this);
 
 
   68        return std::string(
"regex");
 
 
   73        return std::make_shared<validator_regex>(data);
 
 
 
 
   91        cppthread::log << cppthread::log_level_t::error
 
   92                       << 
"validator_regex() only supports one parameter; " 
   94                       << 
" were supplied; single or double quotation may be required?" 
  104    std::regex::flag_type 
flags =  std::regex_constants::extended;
 
  105    if(
regex.length() >= 2
 
  118                flags |= std::regex_constants::icase;
 
  122                cppthread::log << cppthread::log_level_t::error
 
  123                               << 
"unsupported regex flag " 
  125                               << 
" in regular expression \"" 
  135            cppthread::log << cppthread::log_level_t::error
 
  136                           << 
"invalid regex definition, ending / is missing in \"" 
 
  163    return std::string(
"regex");
 
 
validator_regex_factory()
virtual std::string get_name() const override
virtual std::shared_ptr< validator > create(string_list_t const &data) const override
validator_regex(string_list_t const &data)
virtual std::string name() const override
Return the name of this validator.
virtual bool validate(std::string const &value) const override
Check the value against a regular expression.
validator_regex_factory g_validator_regex_factory
The advgetopt environment to parse command line options.
constexpr flag_t option_flags_merge()
std::vector< std::string > string_list_t
Declaration of validators which can be used to verify the parameters.