Menu
Below is the code written in Java Script which compare a give string with the pattern . But I am getting a failed result .
[CODE]
var customer = “Alan Turing 555-1212”;
var pattern11 = /(w+) w+ ([d-]{8})/;
c = pattern11.test(customer);
document.write(“<br>”);
document.write(pattern11);
document.write(“<br>”);
document.writeln(customer);
if (pattern11.test(customer))
{
document.writeln(“Test Passed”);
}else {
document.writeln(“Test Failed”);
}