Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ullebe11224y@N00bPancakes I think that is a great way of seeing it. They certainly feel that way far too often!
-
iiii90854yWait what? Regex is literally a short version of the phrase "regular expression". IMO, the statement is void of logic.
-
ullebe11224y@iiii Regex and regular expressions might have been the same thing in the beginning, but as features like backreferences got added regex grew beyond simply being regular expressions. A "real" regular expression is a strictly defined computer science concept, even if many programmers refer to regex instead when they say "regular expression". This confusion for example brought down parts of Cloudflare some time ago. IIRC it was caused by something expecting a real regular expression, which all run in linear time and thus quite fast, but instead a regex that was much slower than that was used.
-
ullebe11224y@iiii see http://nikic.github.io/2012/06/... for a more thorough explanation of the difference.
-
iiii90854y@ullebe1 regular expressions in computer science are equivalent to "regex" (the reason was stated before).
Your argument is not an argument but a flawed logic of intermixing different domains. When programmers use the term "regular expression" they mean it in programner sense and not as something "regular" from a language theory standpoint.
In a nutshell you're trying to be a snob, but fail at that. -
Lots of misunderstanding here, lots of dick swinging too.
Regular expressions were originally meant to parse regular languages as per the Chomsky hierarchy. Of course, PCRE and Ecmascript extensions have allowed them to parse context-free languages as well to a certain extent, but only superficially.
There was never any claim that regular expressions themselves were regular languages.
Kind of a weird thing to have as a "biggest pet peeve", but also @iiii isn't exactly correct here either.
So yes, when people say "regular expressions", they DO mean it in a "regular language" sense, even if they don't know it. They added backreferences for certain trivial cases, not meant to parse context-free stuff. That's why you don't see parsers written in regex, but instead using LALR/RD parsers and the like (which ARE meant to parse context-free and context-sensitive languages).
It's like saying "when people talk about cryptocurrency they aren't talking about cryptography". Of course they are.
My biggest pet peeve is that too many developers don't realize that "regex != regular expressions", probably because of bad naming and bad documentation. It's easy to assume that they're the same, but most regex syntaxes today are actually at least context-free grammars, since they support backreferences.
rant