I don\'t see how it can work, there are quite a few errors with errors with the regex that I can see. $asc(t) would need to be changed to $asc(\t) and all of the []()/ etc. characters in the regex string should be prefixed with a \ so that they are interpreted as characters and not a closing bracket or something. Also there are special regex escape strings which would be much better for capturing all non alphanumeric characters.