Check if regular expression has been set before trying to parse anything.