Finally, to include a literal - place it last. The period . The preceding item is optional and matched at most once. The preceding item will be matched zero or more times. The preceding item is matched exactly n times.
Repetition takes precedence over concatenation, which in turn takes precedence over alternation.
A whole subexpression may be enclosed in parentheses to override these precedence rules. In addition, certain other obscure regular expressions require exponential time and space, and may cause grep to run out of memory. Backreferences are very slow, and may require exponential time.