I have a QString (which is a URL) from which i want to remove invalid characters like carriage return (\n), tab (\t), \r etc

I tried:
Qt Code:
  1. urlString.remove(QRegExp("[\n\t\r]"));
To copy to clipboard, switch view to plain text mode 

But this doesn't work.

Any help will be appreciated.
Thanks.