I want to use JavaScript (can be with jQuery) to do some client-side validation to check whether a string matches the regex:
^([a-z0-9]{5,})$
const regExpStr = "^([a-z0-9]{5,})$" const result = new RegExp(regExpStr, 'g').test("Your string") // here I have used 'g' which means global search console.log(result) // true if it matched, false if it doesn't