There are other special characters called quantifiers, which always follow immediately after the item they modify, which dictate the number of occurrences that are needed.
Quantifier |
Description |
---|---|
* |
Matches 0 or more of the preceding item. |
+ |
Matches 1 or more of the preceding item. |
? |
Matches either zero or one of the preceding item. |
Numbers in curly braces can be used for more complex quantifiers.
Example |
Description |
---|---|
{N} |
Matches exactly N occurrences. |
{N, M} |
Matches at least N and at most M occurrences. |
{N, } |
Matches at least N occurrences. |