value.replace(/[^a-zA-Z0-9-_?=&/#.:[ \ ]]/g, "");
My understanding of it so far is that the ^ is used for negation and we are matching everything outside of a-zA-Z0-9-_?=&/#.: and the /g just means we are doing a global search. Then we are replacing all those matches with an empty string so essentially just deleting them. However what is [ \ ] doing?