Extracting regular expression definitions from a grammar.