QString - Removing non-alphanumeric chars

I am using this function to remove non-alphanumeric from a QString. I use this function before saving to a file on the OS, I need this since theses char are not permitted by the OS for a filename.

With this function (code under), The compiler is giving me warning that I would like to fix:
warning: C4129: '[' : unrecognized character escape sequence
warning: C4129: ']' : unrecognized character escape sequence

Or maybe there is a function like this that already exists in QString or QFile?
Thank you!