The Above Regular Expression Question was featured on HackerRank,It should return true if string contains Mr./Mrs./Ms./Dr./Er. in the beginning followed by group of letters.
For Eg: Mr.Abc is true but Mr.Abc. isn't But my code returns Mr.Abc. as true.
let inp="Mr.Abc.";
let re=new RegExp(/^Mr\.|^Ms\.|^Mrs\.|^Dr\.|^Er\.[A-Za-z]/);
console.log(re.test(inp));
P.S.Sorry for my Bad Regular Expression statement i'm currently in the learning stage ..