Sign up to request clarification or add additional context in comments.
Comments
4
You can also write...
regex = Regexp.compile(string)
...which is a very descriptive name. This method compiles the source code (string) into a nondeterministic finite automaton (regex). The NFA can then be reused over and over.