Screen scraper to get all 'a title' elements

Marko Rauhamaa marko at pacujo.net
Wed Nov 25 18:53:26 EST 2015


Grobu <snailcoder at retrosite.invalid>:

> Sorry, I wasn't aware of regex being on the dark side :-)

No, regular expressions are great for many purposes. Parsing
context-free syntax isn't one of them.

See:

  <URL: https://en.wikipedia.org/wiki/Chomsky_hierarchy#The_hierarchy>

Most modern programming languages including HTML are context-free. Their
structure is too rich for regular expressions to capture.

Regular expressions can handle any regular language just fine. They are
commonly used to define the lexical tokens of a language.


Marko



More information about the Python-list mailing list