If you ask a question about parsing HTML with regex, you will certainly be referenced to this famous rant. Though there is not a canonical rant for it, I've also been told that regex aren't powerful enough to parse SQL.
I'm a self-taught programmer, so I don't know much about languages from a theoretical perspective. Practically speaking, what are examples of languages or grammars that regex can always parse successfully?
To be specific, I'd really like a few examples of languages that are used in the real world that fit in the category of regular languages, rather than some axioms or equivalent conditions, etc.
Regexes are great for parsing things with only repetitions. They go wrong when you have forms of recursion. I think most useful is showing the simplest language it can't parse:
n open parenthesis followed by n close parenthesis, so for instance: (()) and ((((()))))
If you know you cannot parse that, you can easily conclude that you cannot parse most programming languages.
So I think you could parse basic SQL (though not if you would allow stuff like subqueries). Other prime examples of regex-parseable strings are web adresses, email-adresses, phonenumbers, etc.
If you're looking for actual programming languages which one can parse using regexes you won't find many (though I think (from my limited knowledge of it) parsing assembly should be possible. Most uses however are found in parsing simple strings, or lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With