hello, i got a utf8 string, how could i use C++ regex to judge the string contains only chinese characters, engish letters(a-zA-Z) and digits(0-9), and calculate how much characters the string contains?
For example, i have "hello饿货不哭12", only with the characters mentioned above, length is 11.
Or any other way that can make it more simple and clean.
If you actually need to use regular expressions to classify a Unicode string (as in, to say how many code points are for chinese characters and how many are for english), you will need boost.regex because C++ regex (essentially a 14-year old version of boost.regex) doesn't do Unicode classification.