This might be pretty simple, but I am having a hard time with it. Consider the following code:
var string = 'testingT#$^%#$ESTING__--232'
string = string.match(/^\w*$/)
if (string != null)
{
string = string.join('')
string = string.toUpperCase()
}
$('#my-input').val(string)
What I want to do, is to strip all characters that aren't alphanumeric or underscore from string, and then transform that string to uppercase.
So far I did that, it works perfectly if I don't add any special characters, but when I add - or ^ to it, for example, it deletes everything from #my-input