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
-
IMO, regular expressions are needed mostly for not thinking about HOW MUCH lines of code it's gonna replace, but rather WHEN there's room for user's customization.
new RegExp(userProvidedRegExp, "i")
Also, guys, you'd better off dissing on Perl. -
@Oktokolo perhaps, a "user" I'm talking about should be familiar with regular expressions they add, to avoid "Evil Regexp" opportunities. Sort of more aware users. Obviously, we shouldn't give this power to userbase that's not configuring anything. Especially when program covers all required scenarios already.
-
@vintprox: Doesn't matter how experienced the user is or whether he configures stuff or not. What matters is whether the user is trusted to not be an attacker or controllable by an attacker.
It is fine to give employees the ability to search by regexp - even if they sometimes degrade performance for others a bit. Granting that power to random people from the Internet might be asking for trouble though - especially, when they know regular expressions... -
tbjgolden723yRegex is kinda like the terminal - at first your instinct is to fear it, then you learn it and it's so useful in editor searches that it ends up sticking
Related Rants
There ain’t no feeling like replacing 6 lines of code with 6 characters of Regex.
random
regex