Building a Regexp from unsanitized user input can create catastrophic backtracking patterns.
Escape user input with Regexp.escape or match against a fixed anchored pattern.