PDA

View Full Version : how to include variable name in QRegExp?



aurora
5th January 2012, 10:27
Hi,
How can i include variable in a regular expression?
Actually i want to search a word in a text file.(exact match of the word)
The word is entered through lineedit.
Hence i used

QRegExp rx("\stext");

But that is not working..
here text is the variable, i want only the exact match of the word in the file.
How can i declare that?

Lykurg
5th January 2012, 10:57
QString, QString::arg(), QRegExp::escape().