[Interest] QRegExp exclamation marks

Thiago Macieira thiago.macieira at intel.com
Mon May 27 19:25:17 CEST 2013

On segunda-feira, 27 de maio de 2013 16.48.13, Sensei wrote:
> QRegExp r("\\b(PROGRAM WARNING|!\\s)");
> it matches just the second line, not the "! " patterns.

\b is "word boundary". You need to have a \w (word) on one side and \W (non-
word) on the other. Both the beginning of a line and the exclamation marks are 
non-words, so it will never match.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130527/21910783/attachment.sig>

More information about the Interest mailing list