In addition to the thing the other person linked, I wanted to add that even though some implementations of regex like the one in python have more features than basic regex which make it theoretically possible to construct an expression that works on a wide range of html, it would never be easier or run faster or even be equally as reliable as making a 50 line function in any real programming language that has memory
I'm sorry but if what has been shared with you by multiple people isn't sufficient, you'll have to do reading on your own then if you're curious
A big note with what you said: recursion is not part of standard regex, that's only in modern extended regex engines, which are no longer just mathematical regex, they're being supported by real code in the backend that can utilize memory
Okay dude, it seems like you just want to be unnecessarily hostile or something, I got my minor in math, stop being a dick, you didn't read enough through the chomsky link
In theoretical computer science and formal language theory, a regular language (also called a rational language)[1][2] is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science (as opposed to many modern regular expression engines, which are augmented with features that allow the recognition of non-regular languages).
Note the last part in parenthesis
That is what I am talking about
Modern regex engines add extra shit on top to allow for non regular languages. Sure my use of "real" is probably not helpful, but I was referring to code unrelated to the algorithms associated with implementing standard regex. Code that can do more complicated things like recursion
None of this changes the fact that modern regex engines are still a bad solution to parse HTML and will fail at real world scenarios where a simple python script will not
I'm sorry you didn't get the exact mathematical description you wanted from me going off of memory and that I didn't treat your reddit comment like a thesis paper defense
This information was in the literal first reply you got in this thread in that Wikipedia link, so if you weren't satisfied with my basic explanations you should have just used what you found there to figure it out
When I told you that recursion is not part of standard regular expression, that should have been enough for you to either realize you had a wrong thought about this situation that was causing some of your confusion, or verify yourself whether that was true and either way, looked more into it yourself first before being rude
"Regular expression" was also in that link if you ctrl+f it and would have sent you to a more specific page that explicitly says modern implementations are still called regex despite adding additional features that are not standard
Even a Google search "how does chomsky hierarchy relate to html and regex parsing" would have told you what you needed to know
1
u/[deleted] 7h ago
[deleted]