logoalt Hacker News

StilesCrisistoday at 1:56 PM3 repliesview on HN

Why? Unless it's an extraordinarily hot code path, it doesn't matter. A regex once compiled will be quite efficient.


Replies

gspetrtoday at 4:29 PM

It's simple, unless you're given a specific broader context (like we have an enterprise customer data pruning system that needs to handle a broad range of corner cases) then you must not resort to overengineering this early in an interview.

JCTheDenthogtoday at 5:15 PM

You have a problem, so you try to solve it with a regex. You now have two problems.

Chris2048today at 3:10 PM

And an extra import. also, it sounds like they where looking specifically for knowledge of built-in operators.