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,})$
Here's an example that looks for certain HTML tags so it's clear that /someregex/.test() returns a boolean:
/someregex/.test()
if(/(span|h[0-6]|li|a)/i.test("h3")) alert('true');