Java Regexs of Greedy Quantifiers

A greedy quantifier indicates to search engine to search the entire string and check whether it matches the given regexp. Following are various examples of Greedy Quantifiers using regular expression in java.

Sr.NoConstruct & Matches
1X?X, once or not at all.
2X*X, zero or more times
3X+X, one or more times.
4X{n}X, exactly n times.
5X{n,}X, at least n times.
6X{n,m}X, at least n but not more than m times

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *