Try below Alphanumeric regex
"^[a-zA-Z0-9]*$"
^ – Start of string
[a-zA-Z0-9]* – multiple characters to include
$ – End of string
See more: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
More Related Contents:
- Find the highest number between two literal strings using a Regular Expression
- How to parse a string that contains value only needed partially to an arraylist? [closed]
- How to split a string, but also keep the delimiters?
- Match multiline text using regular expression
- Regex to match a C-style multiline comment
- Regex for matching something if it is not preceded by something else
- Splitting a string at every n-th character
- Parsing XML with REGEX in Java
- Java – Best way to grab ALL Strings between two Strings? (regex?)
- removing invalid XML characters from a string in java
- How do I convert CamelCase into human-readable names in Java?
- Replacing all non-alphanumeric characters with empty strings
- Extracting pairs of words using String.split()
- What is the simplest way to convert a Java string from all caps (words separated by underscores) to CamelCase (no word separators)?
- Java String.split() Regex
- Java – regular expression finding comments in code
- Remove all empty lines
- Given a string, generate a regex that can parse *similar* strings
- How to split a comma separated String while ignoring escaped commas?
- Split string into sentences
- What is the equivalent of Regex-replace-with-function-evaluation in Java 7?
- Regex split numbers and letter groups without spaces
- Java String ReplaceAll method giving illegal repetition error?
- Can java.util.regex.Pattern do partial matches?
- Regular Expression for matching parentheses
- Java Regex – Using String’s replaceAll method to replace newlines
- Replace a String between two Strings
- Does Pattern.compile cache?
- Print regex matches in java
- regex replace all ignore case