The typical response to any "why isn't this regex working html!?!" question is "because HTML isn't a regular language".
So, I was curious if anyone had a list of common programming languages which were regular languages, and thus are appropriate for regular expression matching. I know there are ways to determine if a language is regular (case by case), but for complicated languages the proof can be also quite complicated. I thought perhaps a quick check list of languages could be useful.
I also know that you can do regular expressions with non-regular languages, but that they aren't always reliable (html example).
Disregarding any arbitrary limits on nesting or programming length, I doubt any common programming languages are regular. Even simple (infix) arithmetical expressions form a non-regular language, and it is an unusual programming language that does not support them. More generally, if a language allows nesting of any construct without limiting its depth, it is not a regular language.
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