[Qt-interest] about QRegExp
tang ke
tangk at lemote.com
Mon Nov 22 06:06:20 CET 2010
yes, It's OK
thanks
于 2010年11月22日 12:09, Bob Hood 写道:
> On 11/21/2010 8:37 PM, tang ke wrote:
>
>> I have a string about %%FOOTBALL{XXXXX} YYYYY,and I want to replace this
>> to \football{XXXX}{YYYY}
>>
>> but when I use the QRegExp string "%%FOOTBALL{\(.*\)}\(.*\)" to
>> "\\football{\\1}{\\2}"
>>
>> but It's fail.
>>
>> can you help me?
>>
>
> QRegExp find_football("%%FOOTBALL\\s*\\{(.*)\\}\\s*(.*)");
> index = find_footballindexIn("%%FOOTBALL{XXXXX} YYYYY", 0);
> if(index >= 0)
> {
> QString new_football = QString("\\\\football {%1}
> {%2}").arg(test.cap(1)).arg(test.cap(2));
> ...
> }
>
> Render me gone, |||
> Bob ^(===)^
> ---------------------------------oOO--(_)--OOo---------------------------------
> Character is more easily kept than recovered.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tangk.vcf
Type: text/x-vcard
Size: 487 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101122/bcb02ca5/attachment.vcf
More information about the Qt-interest-old
mailing list