[Interest] question about Qt Regx to match hexdecimal

Bob Hood bhood2 at comcast.net
Sat Mar 30 17:04:30 CET 2013


This works for me (Qt 4.8.3):

    QRegExp re("([0-9a-fA-F]+)");
    assert(re.indexIn("12345ABC") == 0);
    assert(re.capturedTexts()[0] == "12345ABC");


On 3/30/2013 9:07 AM, Vincent Cai wrote:
>
> Dear all,
>
>  
>
>          I tried to create a Qt Regx to match hexdecimal, below is the
> strings I have tried, but all failed.
>
> l  "([0-9a-fA-F]+)"
>
> l  "([A-Fa-f0-9]+)"
>
> l  "([\\dA-Fa-f]+)"
>
>  
>
> The symptom is only 0-9 is returned, for example:
>
> 12345ABC -> 12345
>
> 12AB34EF -> 12
>
>  
>
> Hope you can help!
>
> Thanks,
>
> Vincent.
>
> This message and any attachments may contain Cypress (or its subsidiaries)
> confidential information. If it has been received in error, please advise
> the sender and immediately delete this message.
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130330/3bac9c61/attachment.html>


More information about the Interest mailing list