<html>
<body>
<script type="text/javascript">
var str = "Visit W3xue.com";
var patt1 = new RegExp("W3x","g");
document.write("The regular expression is: " + patt1.source);
</script>
</body>
</html>