Regex Parser (Python version)