Annnnd I’m parsing HTML with regex again.
And now I'm parsing CSS with regex. Because I did not learn my lesson the first time.

Thinking about installing https://pypi.org/project/regex/ just so I can use recursive regex.

Regex: “now you’ve got 2 problems”
Recursive regex: “now you’ve got 2² problems”

https://www.rexegg.com/regex-recursion.html

Client Challenge

Side questing into PEGs and #EBNF grammars (that I only barely understand) to parse #CSS.

https://pypi.org/project/pyparsing/ looks useful, but I found this rudimentary CSS #PEG (https://gist.github.com/erikrose/5624176) which can be used by https://pypi.org/project/parsimonious/ and it… appears to work?

I was already re-writing the current CSS processing (remove the recusion, add in dataclasses to encapsulate domains, etc), but maybe using a more formal grammar would be a good idea. #python

pyparsing

pyparsing module - Classes and methods to define and execute parsing grammars

PyPI