Hey, Sorry to revive an old thread.

I am using your solution:

Qt Code:
  1. QString Util::cleanQString(QString toClean) {
  2.  
  3. QString toReturn = toClean;
  4. toReturn.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\\[\\\]\\\\]")));
  5. return toReturn;
  6. }
To copy to clipboard, switch view to plain text mode 

The compiler is giving me theses 4 warnings that I would like to fix:
warning: C4129: '[' : unrecognized character escape sequence
warning: C4129: ']' : unrecognized character escape sequence
warning: C4129: '[' : unrecognized character escape sequence
warning: C4129: ']' : unrecognized character escape sequence

Using Qt 5.5.0 on VS2013