[Qt-interest] Removing fixed string by QRegExp

Constantin Makshin cmakshin at gmail.com
Sat Apr 17 21:57:48 CEST 2010


Try

str.remove(QRegExp("\\bmy\\b",Qt::CaseInsensitive));

On Sat, 17 Apr 2010 22:14:48 +0400, M. Bashir Al-Noimi <mbnoimi at gmx.com> wrote:
> Hi folks,
>
> Once again I faced a problem with QRegExp... sorry for disturbance :-[
>
> I want to remove fixed string from QString for example:
>
> "This is my mysterious issue"
>
> after removing 'my' it will be:
>
> "This is mysterious issue"
>
> so I tried the followings:
>
> str.remove(QRegExp("my",Qt::CaseInsensitive,QRegExp::FixedString));
>
> str.remove(QRegExp("^my$",Qt::CaseInsensitive));
>
> str.remove(QRegExp("my",Qt::CaseInsensitive,QRegExp::Wildcard));
>
> but no-one didn't fix the issue! Could you please help me?

-- 
Constantin Makshin



More information about the Qt-interest-old mailing list