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 - Possessive quantifiers
Examples of Possessive Quantifiers
A possessive quantifier is similar to greedy quantifier. It indicates the engine to start by checking the entire string.It is different in the sense if it doesn t work, if match failed and there is no looking back. Following are various examples of Possessive Quantifiers using regular expression in java.
Sr.No | Construct & Matches |
---|---|
1 | X, once or not at all. |
2 | X, zero or more times |
3 | X, one or more times. |
4 | X, exactly n times. |
5 | X, at least n times. |
6 | X, at least n but not more than m times |