I am having an issue getting this regular expression to work in IE 7. This code works perfect in FireFox & Netscape, but it does not work in IE7. The error IE 7 gives me is:

Function Expected

Below is the code. Does anyone know why I am getting this error?


<script language="JavaScript">

function test()
   //-- Regular Expression to validate the entered Zip Code
   regZip = new RegExp(/(^\d{5}$)/);
   if( regZip( document.getElementById("zipCode").value ) )
      alert("Thank you for entering a valid Zip Code");
      alert("Entered Zip Code is not valid.");


<input type="Text" id="zipCode" />
<input type="Button" value="validate" onClick="test();" />