5 ms·
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.
by tyho 2mo 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.
- gpvos 2mo agoDo 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.
- magicalist 2mo agoZalgo 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.
- deleted 2mo ago[deleted]
- vrighter 2mo agoand you write your regex specifically for that document length, handling all possible nesting combinations. combinatoric explosion