regex do not allow spaces code example
Example: regular expression not to allow space in javascript
var regexp = /^\S*$/; // a string consisting only of non-whitespaces
var regexp = /^\S*$/; // a string consisting only of non-whitespaces