Remix.run Logo
tyho a day ago

You can absolutely parse HTML with regex, so long as the document is finite in length. Every finite language is regular, hence can be parsed with regex's.

magicalist a day ago | parent | next [-]

Zalgo and situational subset parsing aside:

> You can absolutely parse HTML with regex, so long as the document is finite in length

This isn't sufficient, unless I'm misinterpreting what you're saying. It's not enough to have documents of finite length (all documents are finite in length), you need documents with a max length, so you have a finite number of possible documents to parse.

gpvos a day ago | parent | prev | next [-]

Do a web search for the parent of your comment, read the Stackoverflow answer. It's a classic. Learn about Zalgo and Tony the pony, he comes.

vrighter 16 hours ago | parent | prev | next [-]

and you write your regex specifically for that document length, handling all possible nesting combinations. combinatoric explosion

a day ago | parent | prev [-]
[deleted]