Menu
I am stumped by the js “match” function. ‘S’ returned ‘x’ in a regular expression tester but the following code returns ‘null’. Why doesn’t the following code return ‘x’ as expected? I appreciate your advice.
[CODE]<html>
<body onload=”
var str=’xx’;
document.write(‘str = ‘ + str);
document.write(‘<br>str.match(‘\S’) = ‘ + str.match(‘S’));
// ‘S’ should return any character that is not a white space
“>
</body>
</html>