I have 2 types of DCRs, an index and a catch all DCR. There are only 4 index (somedir/default) and I want to prevent the catchall from using the same name.
My regex is a Perl stype (using \Q \E with a variable in between) but is is not catching the match in JS. Since I am on a DOS platform I need to make certain it is a case insensitive match.
Tips/Pointers/RTFMs as to why my JS regex is not working ?
var DCRName = IWDatacapture.getItem("/Root/DCRName").getValue();
var indexArray = new Array ( "dir1/default", "dir2/default", "dir3/default", "dir4/default");
for (var i = 0; i < indexArray.length; i++)
{
var pattern =/\QindexArray\E/i;
var out = pattern.test(DCRName);
if (out) {
alert("Cannot use name of Index page");
IWDatacapture.getItem("/Root/DCRName").setValue('');
return;
}
}