QRegularExpression question.



  • 0_1478394416251_upload-8a59c186-4a90-47de-a974-5820c07a807f
    the top half code shows match value is 0.
    But the bottom half code shows hasMatch value is 1,seems QRegExp class exactMatch() match completely, but QRegularExpression class match partially.

    Any body knows how to make QRegularExpression do completely match?



  • Hi @samzhcs1,

    Any body knows how to make QRegularExpression do completely match?

    As per Exact Matching, you simply ensure your expression begins with ^ and ends with $.

    In your examples above, you have the starting ^ already, but not the finishing $ anchor.

    Cheers.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.