Check whether a string matches a regex in JS Check whether a string matches a regex in JS javascript javascript