"[g-zG-Z||а-яА-Я||( )||~||`||!||@||#||$||%||^||&||*||(||)||_||+||/||ё||Ё||!||\"||№||;||:||?||-||=||\\[||\\]]";
It works :) But I would like to write something shorter. The essence of the expression is such that it is paired with DocumentFilter does not allow the user to enter any extraneous characters, except those relating to the HEX calculus system.