5 exercises on saying regular-expression symbols aloud.
0 / 5 completed
1 / 5
In regex, the "*" symbol is most precisely named what when read aloud?
The * symbol is formally the asterisk /ˈæstərɪsk/ (three syllables, stress on the first), though developers very commonly call it "star" when reading regex or globs. So "dot star" for ".*", or "asterisk." Note the spelling has an "-isk" ending, not "-ick" — a common mispronunciation is "asterix" or "asterick." In regex it means "zero or more," but its name when spoken is "star" or "asterisk." (Unix old-timers also say "splat.")
2 / 5
In regex, the "^" symbol (anchor / start of line) is named what?
The ^ symbol is the caret /ˈkærət/ — pronounced like the vegetable "carrot," two syllables, stress on the first. Developers also call it "hat" (because it sits on top). So "caret a-z" for "^a-z", or "hat." Its formal typographic name is "circumflex," but in code people say "caret" or "hat." Do not confuse the spelling with "carrot" (vegetable) or "karat" (gold) — though they all sound alike, /ˈkærət/.
3 / 5
In regex, the "$" symbol (end-of-line anchor) is named what?
The $ symbol is read as "dollar" or "dollar sign" /ˈdɒlər/ — two syllables, stress on the first. So in regex "a-z dollar" means "[a-z]$" (matching at end of line). Even though in regex it has nothing to do with money, the symbol's name is still "dollar (sign)." It is also called "dollar" in shell variables ("dollar PATH" for $PATH). Do not call it "cash" or "string."
4 / 5
In regex, the "?" symbol is named what when read aloud?
The ? symbol is read as "question mark" /ˈkwɛstʃən mɑːrk/. So in regex "colou question mark r" describes "colou?r" (matching "color" or "colour"). In code generally it is "question mark" — for example the ternary "a question mark b colon c." Some say "query" informally in URLs ("the query string"), but the symbol's name is "question mark." It means "zero or one" (optional) in regex.
5 / 5
In regex, the "|" symbol (alternation) is named what?
The | symbol is called the "pipe" /paɪp/ in everyday developer speech, or formally the "vertical bar." So in regex "cat pipe dog" means "cat|dog" (match either). The name "pipe" comes from its use in shells to connect commands ("grep pipe sort"). Do not call it "slash" (that is /) or the letter "I." In regex it means "or" / alternation; spoken, it is almost always "pipe."