[^\d] - This is a regular expression for "not numbers."
In details
[]represents a "character class" or a group of characters to match.
\dis a shortcut for 0-9or for any number.
^in a character class, negates the class.
function unformat(t)
{
return t.replace( /[^\d]/g, '' );
}
In any case, you cannot access such a line as in one of the main browsers. You will need to use str.charAt(x).