I have the following code that matches just fine.
var re;
re = /23-Apr-2004/gi;
alert(re.test(document.all['thebody'].innerHTML));
However, when I attempt it with a variable containing the same characters it
thows the error
"Object doesn't support this property or method" on the test line below.
var months = new
Array('Jan','Feb','Mar','Apr','May','Jun','Jul','A ug','Sep','Oct','Nov','Dec
');
var now = new Date();
var today = now.getDate() + "-" + months[now.getMonth()] + "-" +
now.getYear();
today = "/"+today+"/gi";
var re;
re = today;
alert(re.test(document.all['thebody'].innerHTML));
Can anyone tell me why this isn't working and perhaps a way around it?