
246 ◾ Computational Thinking for the Modern Problem Solver
e string literal “123-45-6789”, for example, follows the pattern that all
Social Security numbers must follow. e pattern of Social Security num-
bers is understood to be any 3 digits followed by a dash (-) followed by any
2 digits followed by a dash followed by any 4 digits. A string literal that
matches this pattern can be reasonably understood as a member of the
Social Security number family, whereas a string literal that does not match
this pattern is not a Social Security number.
In computer programming, patterns are known as regular expressions.
A regular expression denes ...