3 ms·
its nothing to do with the regex. its the algorithm and its suitability 'any function containing test in its name' being a test is a stinky practice. using som
by jheriko 11y ago
its nothing to do with the regex. its the algorithm and its suitability 'any function containing test in its name' being a test is a stinky practice.
using something well defined is what i would expect from any programmer at any level.
this is what we call a 'hack'... and its a particularly revolting one.
- eridius 11y agoI'm going to go out on a wild limb here and guess that you have no clue whatsoever what a regex is, because your comment makes absolutely no sense. The original regex from the article is wildly broken, yes. But the trival regex /\b[Tt]est/ does not match "any function containing test in its name". And this regex is extremely well-defined. The fact that you can't understand it, and the fact that you are making no effort whatsoever to learn even the most basic stuff about regexes, does not make this a 'hack', it just makes you one.
- jheriko 11y agonope. use them every day, but not as a pro expert because its rarely necessary. i don't know what \b is off the top of my head but i'd guess at word boundary so its only checking for functions starting with test, which is equally bad... matching strings contents of function names is not a good way to work. using well defined constructs is. thank you for the hate though.