Space validation for username
validating space in a string or checking whether space is there or not in the string using below regex function
1 2 3 4 5 6 |
<script> var regex = /^[a-zA-Z0-9.\-_$@*!]{3,30}$/; var username=' vasant-han '; var results=regex.test(username); alert(results); </script> |