QRegExpValidator (read carefully the detailed description part, there's an example...)