views:

293

answers:

4

I have a Unicode string consisting of letters, digits and punctuation marks. Ho can I detect characters that are digits and letters (not necessarily ASCII) with a C++ standard library or Win32 API?

+2  A: 

This Microsoft documentation page describes "Unicode character classes" in regular expressions, which sounds highly relevant. I think the answer is in the .Net domain, and not pure Win32 C++, but perhaps you can dig something up.

unwind
Link leads to Regex syntax reference.
n0rd
+4  A: 

I recommend the ICU library. It has all that Unicode data, as well as a decent Unicode string class for C++.

Dietrich Epp
+9  A: 

iswdigit(), iswalpha() and iswalnum() are the functions you are looking for.

Cheers !

Magnus Skog
+4  A: 

Another option is the Win32 API call GetStringTypeW()

Nemanja Trifunovic
That looks like the right thing to use.
Rob K