A simple regex rule interpreter