QString QRegExp 正则匹配

来源:互联网 发布:java工程师是什么意思 编辑:程序博客网 时间:2024/05/19 22:45

你可以使用QRegExp::exactMatch来判断一个字符串是否符合一个pattern。

{
    QString pattern(“.*=.*”);
    QRegExp rx(pattern);

void testRegexMatch()

    bool match = rx.exactMatch(“a=3″);
    qDebug() << match;                      // True

0 0