|
Using Quantifiers in regular expressions
Quantifiers are used to specify the number of occurrences to match against. There are very useful in declaring patterns in real life applications. Lets explore this:
X{n} – means exactly n occurrences of X.
X{n,} – means at least n occurrences of X and there is no limit for maximum occurrence.
X{n,m} – means at least n and at most m occurrences of X.
X+ - means one or more occurrences of X.
x*- means zero or more occurrences of X.
|