Pattern matching, which plays a key role in Go, is a technique for searching a string for some set of characters based on a specific search pattern that is based on regular expressions and grammars. If pattern matching is successful, it allows you to extract the desired data from the string, replace it, or delete it.
The Go package responsible for defining regular expressions and performing pattern matching is called regexp. You will see it in action later in this chapter.
When using a regular expression in your code, you should consider the definition of the regular expression as the most important part of the relevant code because the functionality of that code depends on the regular expression.