解决正则中文
public static int getlength(string strsource)
{
regex regex = new regex("[u4e00-u9fa5]+", regexoptions.compiled);
int nlength = strsource.length;
for (int i = 0; i < strsource.length; i++)
{
if (regex.ismatch(strsource.substring(i, 1)))
{
nlength++;
}
}
return nlength;
}