<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> <script language="javascript"> <!-- var p = /\s/; var strH = ' test';//Space at head var strB = 'te st';//Space at body var strT = 'test ';//Space at tail var strA = ' te st ';//Space at head & body & tail alert('resultH='+p.test(strH)+'\n'+'resultB='+p.test(strB)+'\nresultT='+p.test(strT)+'\nresultA='+p.test(strA)); // --> </script> </head><body></body> </html>
<html>
<head>
<title> New Document </title>
<script language="javascript">
<!--
var p = /\s/;
var strH = ' test';//Space at head
var strB = 'te st';//Space at body
var strT = 'test ';//Space at tail
var strA = ' te st ';//Space at head & body & tail alert('resultH='+p.test(strH)+'\n'+'resultB='+p.test(strB)+'\nresultT='+p.test(strT)+'\nresultA='+p.test(strA));
// -->
</script>
</head><body></body>
</html>