[Interest] QRegExp exclamation marks

Sensei senseiwa at gmail.com
Mon May 27 16:48:13 CEST 2013


Hi all, this is quite simple, I hope!

I am trying to use the regexp application to find all patterns I need 
before coding. Now, I'd like to match full words that have this patterns:


! This is the text

PROGRAM WARNING: This is the text


I've come with the following:

QRegExp r("PROGRAM WARNING|!\\s");


and it matches strings like:

! What is this?  ==> index 0, length 2
PROGRAM WARNING: some text ==> index 0, length 15


I would like to match just full patterns, but I fail to make a valid 
QRegExp behave like I'd like, like this one


QRegExp r("\\b(PROGRAM WARNING|!\\s)");


it matches just the second line, not the "! " patterns.

What do you suggest?


Thanks!



More information about the Interest mailing list