怪我咯2017-04-17 12:59:57
I remember that the book Python Basic Programming mentioned how to write a text parser.
Python's Lib comes with HTML parsing. HTMLParser
I think it will be easier to read this.
大家讲道理2017-04-17 12:59:57
Parsing these formats is almost the same as grammatical analysis of compilation principles.
First make the token, and then enter the state machine to generate a parse tree or something.