Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Howto design a regular expression?

$
0
0
Hi everyone, this is my first contact with the Qt framework (so please be gentle ;) ). I’ve got a source code from an existing application on the Nokia N9 an try to fix a problem with input strings. The main term of the application is to get the textsource of html site and filter all hyper-links beginning with imgurl= and ending with ? – so I think the best way to handle this is a regular expression. But how does i design a regexp ? Or maybe there is a better solution? QString line = in.readLine(); QSet<QString> urls;   if (!regExp.cap(1).isNull()) {               QStringList imglist = line.split("imgurl=", QString::SkipEmptyParts);             for (int i = 0; i < imglist.size(); ++i) {                //imglist.at(i).remove(!()) //Negotiate the RegExpression?                urls.insert(imglist.at(i).toLatin1());                qDebug() << "[IMG] - URL: " << imglist.at(i);             }         }  

Viewing all articles
Browse latest Browse all 18427

Trending Articles