PDA

View Full Version : QRegExp



evgenM
12th May 2006, 12:47
i have
if ( text.endsWith("}") || text.endsWith("};") )
and i want to replace it by
if ( text.indexOf(QRegExp("};?$")) != -1 )

but is not same thing - why?
How make right regExp?

jacek
12th May 2006, 13:41
Curly braces have a special meaning in regexps, try this:
... QRegExp( "\\};?$" ) ...

wysota
12th May 2006, 13:44
And double backslash to escape the backslash in a C string.

evgenM
12th May 2006, 14:22
lol - i forget (stupid error
thanx all