ANTLR is a great tool to quickly create parsers and help you in working with a known language or create your DSL. While the tool itself is written in Java it can also be used to generate parsers in several other languages, for instance Python, C#, Javascript, C++, PHP, etc.
This is the companion repository of the article Getting Started With ANTLR in PHP. This example shows how to parse Roman numerals in an HTML file and output some annotations around a Roman numeral.