expands regular expressions, returns minimal distance