Home > Back-end >  Regular expressions
Regular expressions

Time:09-18

#include
#include
#include
#include

Int main (int arg c, char * argv [])
{
QCoreApplication a (arg c, argv);
QString s="; Layer 21 ";
QRegularExpression re (" ^ (;) (layer (? | : [2-9] [0-9] {2, 3})) * $");
QRegularExpressionMatch match=re. Match (s);
{if (match. HasMatch ())
QString currFileName=match. Captured (2);
QDebug () & lt; }
This result currFileName=layer 2 why not layer 21???????
  • Related