<html>
<body>
<script>
var str="Hello world!";
//look for "Hello"
var patt=/Hello/g;
var result=patt.exec(str);
document.write("Returned value: " + result);
//look for "ZiQiangXueTang"
patt=/ZiQiangXueTang/g;
result=patt.exec(str);
document.write("<br>Returned value: " + result);
</script>
</body>
</html>