Properly escape definitions when sending through Regex

Stupid regex, trying to be dynamic.