3 ms·
Why? Unless it's an extraordinarily hot code path, it doesn't matter. A regex once compiled will be quite efficient.
by StilesCrisis 5mo ago
Why? Unless it's an extraordinarily hot code path, it doesn't matter. A regex once compiled will be quite efficient.
- Chris2048 5mo agoAnd an extra import. also, it sounds like they where looking specifically for knowledge of built-in operators.
- gspetr 5mo agoIt'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.
- JCTheDenthog 5mo agoYou have a problem, so you try to solve it with a regex. You now have two problems.
- suttontom 5mo agoThis is a good example of being bad at writing code.