I created the following pattern: ((\s|[0-9])[0-9]{1}:[0-9]{2}\sPM:)
This regular expression will work to find the following pattern:
Giving the following text "Christina Perry 8:30 PM:"
it should match with 8:30 PM:
or 18:30 PM:
.
It's working properly here https://regex101.com/r/DouyiU/2 however, it's always returning false in my JavaScript code:
var patt = new RegExp("((\s|[0-9])[0-9]{1}:[0-9]{2}\sPM:)");
return (patt.test("Christina Perry 8:30 PM:"));
The desired result is to return true, or: Yes, there is this pattern on the giving sentence;
What am I doing wrong?