You can also match case insensitive regexs and make it more readable by using the Pattern.CASE_INSENSITIVE constant like:
Pattern mypattern = Pattern.compile(MYREGEX, Pattern.CASE_INSENSITIVE);
Matcher mymatcher= mypattern.matcher(mystring);
More Related Contents:
- How to determine if a number is binary and has an even amount of zeros with only one regex?
- Extract Substrings using regex Java [closed]
- Remove HTML tags from a String
- What do ^ and $ mean in a regular expression?
- Java – escape string to prevent SQL injection
- Regex for splitting a string using space when not surrounded by single or double quotes
- String.replaceAll(regex) makes the same replacement twice
- Rationale for Matcher throwing IllegalStateException when no ‘matching’ method is called
- Regular expression with variable number of groups?
- Is it possible to match nested brackets with a regex without using recursion or balancing groups?
- Escaping special characters in Java Regular Expressions
- java regular expression to extract content within square brackets
- How to split String with some separator but without removing that separator in Java? [duplicate]
- Java regex for support Unicode?
- What is the use of Pattern.quote method?
- Java: Split string when an uppercase letter is found
- Is Java case-sensitive? [closed]
- Java Regex to Validate Full Name allow only Spaces and Letters
- Regex to match words of a certain length
- Java regular expression OR operator
- regex to match substring after nth occurence of pipe character
- Understanding regex in Java: split(“\t”) vs split(“\\t”) – when do they both work, and when should they be used
- How to replace ” \ ” with ” \\ ” in java
- Why doesn’t this regex work as expected in Java?
- Validate a file name on Windows
- Java split is eating my characters
- Regular expression to validate username
- “No match Found” when using matcher’s group method
- Case insensitive matching in Java switch-case statement
- Issue with below snippet on boundary matchers regex (\b)