Seems pretty simple, but cannot figure out why this javascript code isn\'t working returning false, when expecting true) - I\'m guessing it has got to do something with the esca
If you want to match something there, but no whitespace:
alert(/^\S+$/.test(value));