This should match any of the specified characters and no others.
/^[$0-9a-z+\-\/*]+$/
Note: the ‘-‘ character needs to be escaped in selection groups like this since it generally signifies a range of possible characters (i.e. a-z or 0-9).
More Related Contents:
- Why it’s not possible to use regex to parse HTML/XML: a formal explanation in layman’s terms
- What is the difference between .*? and .* regular expressions?
- Using regular expressions to validate a numeric range
- How can test I regular expressions using multiple RE engines? [closed]
- Regular expression for first and last name
- The recognizing power of “modern” regexes
- What is a regular expression for a MAC Address?
- How to use regex with find command?
- What is the best regular expression to check if a string is a valid URL?
- Check if a string matches a regex in Bash script
- Regular expression for exact match of a string
- Regular expression for matching latitude/longitude coordinates?
- Regex to disallow more than 1 dash consecutively
- Is it possible for a computer to “learn” a regular expression by user-provided examples?
- Regex, every non-alphanumeric character except white space or colon
- How .* (dot star) works? [closed]
- How do you extract IP addresses from files using a regex in a linux shell?
- regex for zip-code
- Regex to match 2 digits, optional decimal, two digits
- Extracting top-level and second-level domain from a URL using regex
- HTML5 input pattern search for quote
- regex to remove ordinals
- Replace a word with multiple lines using sed?
- Regular Expression Vs. String Parsing
- Can extended regex implementations parse HTML?
- How to get Vim to highlight non-ascii characters?
- Design DFA accepting binary strings divisible by a number ‘n’
- Regex matching beginning AND end strings
- Regex return file name, remove path and file extension
- Matching url with array list of words in AngularJS ui-router