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

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -