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,})$
try
/^[a-z\d]{5,}$/.test(str)
console.log( /^[a-z\d]{5,}$/.test("abc123") ); console.log( /^[a-z\d]{5,}$/.test("ab12") );