3 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 4mo 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 4mo 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.
- deleted 4mo ago[deleted]
- magicalist 4mo 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.
- vrighter 4mo agoand you write your regex specifically for that document length, handling all possible nesting combinations. combinatoric explosion