c++ - regex 1 character and space only -


hi learning regex.. trying make regex expression following conditon:

  1. any letter in sequence given below - c-mpstv-xz condition should not repeated.
  2. this letter can have 1 blank space in front or ie can " c" or "c "

    [c-mpstv-xz{1} ]{2}

i trying above expression {1} expected 1 character , space after allowing 1 space only. @ end of string put {2} 2 character .

i expecting regex_match false input "xx" not working.

appreciate help.

\s?[c-mpstv-xz]\s?. if using std::regex_match, shouldn't need else, since regex_match requires match on entire string.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -