Hacker News new | past | comments | ask | show | jobs | submit login

Well, most commonly used features like back-references allow to define not-regular language, so there is nothing funny that most regular expression engines are not "regular".

I like to use term regex for "regular" expressions implemented in most languages, by PCRE engine or in Perl and term regular expressions for actual regular expressions as defined in theoretical computer science, that is expressions which can be recognised by finite (either deterministic or non-deterministic) automata.




>Well, most commonly used features like back-references allow to define not-regular language, so there is nothing funny that most regular expression engines are not "regular".

The funny thing is that they're still called regular.


Would it make sense to classify them as irregular expressions?


Maybe, but there's an actual hierarchy of languages (or grammars) based on expression capability -- regular languages are at the base.

There's (in more powerful order): context-free, context-sensitive, recursively-enumerable.

https://en.wikipedia.org/wiki/Chomsky_hierarchy


I think most people call them extended regular expressions.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: