javascript - Regex for a special character with only space as a chracter -


i have jquery plugin allow/not allow special characters , have been using regex method allow special characters -_*@#$%&,."\'?;:

but don't want allow special characters white space special character. how can achieve using regex method.

if need match regular space ' ' can escape space character '\ '. if need match whitespace character can use special character \swhich match whitespace character such space ' ', tab \t, newline \n or carriage return \r.

check following examples.

regular spaces /\ /g: http://regexr.com/3gng6

any whitespace character /\s/g: http://regexr.com/3gng3


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -