Hello all
I have a such working expression set on a line edit:
it works well.
But the point is how to make a negation of such expression?I tried ^(?![?<>:*|\"])$ but it does not work :/
Could you help me?
Printable View
Hello all
I have a such working expression set on a line edit:
it works well.
But the point is how to make a negation of such expression?I tried ^(?![?<>:*|\"])$ but it does not work :/
Could you help me?
Your initial pattern matches a string consisting of zero or more characters from the list; ?, <, >, :, *, | and "
By my reckoning the inverse of that would be a non-zero length string that does not contain any of those characters:
Thanks a lot Chris,that's exactly I was needed.
But please explain me what that + does?I found nothing about it in the Qt Assistant
+ means 1 or more instances of the previous element.
Incidentally, it is shorter to use * than {0,} for zero or more ocurrences.
a* (match zero or more 'a')
The +, *, and ? quantifiers are documented in the QRegExp documentation. These symbols are universal in regular expression engine implementations.