Qt-interest Archive, January 2007
RE: [Qt 4.2.0] QRegExp
Message 1 in thread
Hi Nil
If it works it works... maybe optimize... maybe not ;)
But I am not even sure the reg exp I gave you "works", are you sure you want
all hexadecimal with exactly 2 digits. Should your regular expression
capture '02' instead of '2', should it capture '00' instead of '0'. This is
stuff you can play with the regexp tester program Qt comes with. Look under
tools/regexp/ with your Qt installation. It is loads of fun!
Another way of going about it, since you are just excluding one string "F7"
from your set, is by using the first regular expression you suggested (this
one I believe is all hexadecimal with at most 2 digits) and then just test
that it's not equal to "F7".
It is just my two cents!
Christo
>From: "nilitonilito nilitonilito" <nilitonilito@xxxxxxxxxxx>
>To: probst_christopher@xxxxxxxxxxx
>Subject: RE: [Qt 4.2.0] QRegExp
>Date: Mon, 22 Jan 2007 23:12:31 +0100
>
>Hi Christopher,
>
>Thanks for your suggestion, I was expecting something more compact using
>some kind of conjonction but since it works I'll go with that.
>Thanks again.
>Cheers,
>Nil
>
>
>>From: "Christopher Probst" <probst_christopher@xxxxxxxxxxx>
>>To: nilitonilito@xxxxxxxxxxx
>>Subject: RE: [Qt 4.2.0] QRegExp
>>Date: Mon, 22 Jan 2007 20:22:34 +0000
>>
>>Hello Nil,
>>
>>I am not an expert on regular expressions, so I would suggest this naive
>>one that I tested with Regex tester part of the examples programs provided
>>with Qt. It looks like
>>([A-E]|\\d)([A-F]|\\d)|F([A-F]|[0-6]|[8-9]) (in C++) may work in your
>>case.
>>It matches (hopefully) all hexadecimal with exactly 2 digits except for
>>F7. Capture#1 gives the first digit and Capture#2 gives the second digit.
>>
>>It is now nightime in Europe, and I know that Europeans love this kind of
>>stuff, so I am sure you'll get perhaps a more "effective" regular
>>expression tomorrow.
>>
>>You can also try the Regex tester given with Qt example programs, I am
>>sure they package it with Qt4.
>>
>>Christopher
>>
>>>From: "nilitonilito nilitonilito" <nilitonilito@xxxxxxxxxxx>
>>>To: qt-interest@xxxxxxxxxxxxx
>>>Subject: [Qt 4.2.0] QRegExp
>>>Date: Mon, 22 Jan 2007 20:06:10 +0100
>>>
>>>Hi there,
>>>
>>>I would like to formulate the following QRegExp :
>>>
>>>All hexadecimal number of 2 digits except F7.
>>>
>>>I know how to formulate all hexadecimal with 2 digit :
>>>
>>>([A-F]|\\d){1,2}
>>>
>>>I know how to formulate not F7 :
>>>
>>>(?!F7)
>>>
>>>but I don't know how to formulate their conjonction?
>>>
>>>Thanks for your help
>>>Cheers,
>>>Nil
>>>
>>>_________________________________________________________________
>>>Découvrez le Blog heroic Fantaisy d'Eragon!
>>>http://eragon-heroic-fantasy.spaces.live.com/
>>>
>>>--
>>>To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>>"unsubscribe" in the subject or the body.
>>>List archive and information: http://lists.trolltech.com/qt-interest/
>>>
>>
>>_________________________________________________________________
>>Ne perdez pas de temps dans les files d?attente? magasinez en ligne.
>>http://magasiner.sympatico.msn.ca
>>
>
>_________________________________________________________________
>Ten : Messenger en illimité sur votre mobile !
>http://mobile.live.fr/messenger/ten/
>
_________________________________________________________________
Ne perdez pas de temps dans les files d?attente? magasinez en ligne.
http://magasiner.sympatico.msn.ca
--
[ signature omitted ]