Refactor: regex seems more ideal, but more complicated.