quantifier
A regular expression symbol that says how many times the item before it may repeat, such as a star for any number or {2} for exactly two.
In more detail
A star means any number, a plus sign one or more, a question mark zero or one, and {n} exactly n. In basic syntax the plus and question mark are not special and braces need backslashes; in extended syntax (-E) they all work directly. A star applies only to the single item before it, so ab* matches a followed by any number of b.
Related terms
- regular expression — A pattern language for matching text, where characters such as ., *, ^ and $ have special meanings.
- extended regular expression — The two regular expression dialects of Unix tools: basic (BRE), used by grep and sed by default, and extended (ERE), selected with -E.
Taught in
- Finding Lines: grep And Regular Expressions — Bash Scripting & Command Line Automation