var regex = /^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._-]+$/g
Should work
Also may want to have a minimum length i.e. 6 characters
var regex = /^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._-]{6,}$/g
More Related Contents:
- Javascript Array – Split string at numbers [closed]
- What’s the best way to validate an email address in JavaScript?
- Why do regex constructors need to be double escaped?
- Why this javascript regex doesn’t work?
- How can I match a whole word in JavaScript?
- How do I get the YouTube video ID from a URL?
- How can I match overlapping strings with regex?
- Javascript and regex: split string and keep the separator
- Javascript Regex: How to put a variable inside a regular expression? [duplicate]
- How to escape regular expression special characters using javascript? [duplicate]
- Regular Expression for password validation
- Recursive matching with regular expressions in Javascript
- How can I match multiple occurrences with a regex in JavaScript similar to PHP’s preg_match_all()?
- utf-8 word boundary regex in javascript
- Works in Chrome, but breaks in Safari: Invalid regular expression: invalid group specifier name /(?
- Javascript – return string between square brackets
- How to prevent Javascript injection attacks within user-generated HTML
- How to extract base URL from a string in JavaScript?
- Strange JavaScript idiom – what does “/xyz/.test(function(){xyz;})” do?
- Split string into sentences in javascript
- regex to find url in a text
- JavaScript regex – How to wrap matches with tag?
- Javascript replace with reference to matched group?
- Negative lookahead Regular Expression
- Regex exec only returning first match [duplicate]
- Regex to match words with hyphens and/or apostrophes
- Regular expression for number with length of 4, 5 or 6
- What’s different between Python and Javascript regular expressions?
- Extract keyword from Google search in Javascript
- Regex matching emoticons