c++ - regex 1 character and space only -
hi learning regex.. trying make regex expression following conditon:
- any letter in sequence given below - c-mpstv-xz condition should not repeated.
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
Post a Comment