I’m fighting for some time to create a QRegExp for matching the string (??) (ie: an opening parantheses, two question marks and a closing parantheses and this should be a separate word, so before and after this can be spaces, tab, newline), The closest I came up with is QRegExp("\\b\\(\\?\\?\\)\\b"); but even this is not matching it… Can you help me with this?
Thanks
f.
I don’t know QRegexp, but
\bonly matches between alphanumeric and non-alphanumeric characters, so your regex would match(??)only if it was directly surrounded by alnums (likeabc(??)123).So you need a different approach. Hoping QRegexp supports lookaround, you could use
so the regex checks if there is whitespace or start/end of string before/after
(??).If that doesn’t work, you’ll have to match the whitespace explicitly: