Java Regex Tutorial
Selected Reading
- Java Regex - Discussion
- Java Regex - Useful Resources
- Java Regex - Quick Guide
- Java Regex - Logical Operators
- Java Regex - Possessive quantifiers
- Java Regex - Reluctant quantifiers
- Java Regex - Greedy quantifiers
- Java Regex - Boundary Matchers
- Unicode Character Classes
- Java Regex - JAVA Character Classes
- POSIX Character Classes
- Predefined Character Classes
- Java Regex - Character Classes
- Java Regex - Characters
- PatternSyntaxException Class
- Java Regex - Matcher Class
- Java Regex - Pattern Class
- Java Regex - MatchResult Interface
- Java Regex - Capturing Groups
- Java Regex - Overview
- Java Regex - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java Regex - Character Classes
Java Regex - Matching Character Classes
Following are various examples of matching character classes using regular expression in java.
Sr.No | Construct & Matches |
---|---|
1 | a, b, or c (simple class). |
2 | Any character except a, b, or c (negation). |
3 | a through z or A through Z, inclusive (range). |
4 | a through d, or m through p: [a-dm-p] (union). |
5 | d, e, or f (intersection). |
6 | a through z, except for b and c: [ad-z] (subtraction) |
7 | a through z, and not m through p: [a-lq-z](subtraction). |