Remove regex match

Remove [brittle] regex in favor of a simpler solution.