Converting regular expressions to rules.