正则表达式的使用例子:
QString filename = "test";
//检测是否是中文字符、大小写、数字或者“_”
QRegExp reg("^[\u4E00-\u9FA5A-Za-z0-9_]+$");
if(!reg.exactMatch(filename))
{
//文件名不匹配
}
正则表达式 – 教程 | 菜鸟教程 https://www.runoob.com/regexp/regexp-tutorial.html
正则表达式在线测试和常见正则表达式 | 菜鸟工具 https://c.runoob.com/front-end/854
浙公网安备 33010602011771号