HiGuys,
Back again with a problem(most probably a silly one).
I have written a function that will find a specifc pattern (in my case a date string in format mm-dd-yyyy.This date can be at any position in the input string) and replace it with something other string .
The following is the function for that :
***************************************************************
function ReplaceDate(strInput)
{
var strResult;
var objRegex = new RegExp("\d{1,2}-\d{1,2}-\d{4}"); //mm-dd-yyyy
strResult = strInput.replace(objRegex, "HERO");
return(strResult);
}
***************************************************************
The regular expression used to search the date string looks fine.
The problem is that when i call this function , the function is NOT able to FIND& REPLACE date even though there is a date present in mm-dd-yyyy format in the input string.
Can you please tell me where am i going wrong?
Amish