java.util.regex Code Samples
- How do I create a string search and replace using regex?
- How do I split-up string using regular expression?
- How do I do regular expression in Java?
- How do I determine if a string match a pattern exactly?
- How do I check if a string starts with a pattern?
- How do I find and replace string?
- How do I use logical OR operator in regex?
- How do I write embedded flag expression?
- How do I do boundary matching in regex?
- How do I use capturing groups in regex?
- How do I match a regex pattern in case insensitive?
- How do I count the number of capturing groups?
- How do I write simple character class regex?
- How do I write character class subtraction regex?
Page 1 of 2 |
Prev
|
Next
How do I match a regex pattern in case insensitive?
Finding the next subsequence of the input sequence that matches the pattern while ignoring the case of the string in regular expression can simply applied by create a pattern using compile(String regex, int flags) method and specifies a second argument with PATTERN.CASE_INSENSITIVE constant.
Here is the result of the program:
Text "brown" found at 10 to 15. Text "BROWN" found at 24 to 29.