3 ms·
I think there's two parts to this: first, if you know your input meets certain constraints, then there's no benefit to over-complicating the solution. Second, t
by 613style 5y ago
I think there's two parts to this: first, if you know your input meets certain constraints, then there's no benefit to over-complicating the solution. Second, this is a teaching tool. It makes sense to start simply and save the harder version for later.
- cbsmith 5y agoIs it really so awful to do "grep -o '\b\w+%'"? It still won't handle extra space padding at the end of the line, but it's still a lot less ugly than assuming the word after the first space is a last name.
- cbsmith 5y agoWeird, not sure why it did % instead of $ there.
- RasmusLarsen 5y agoIn the context of trying to teach people basics, yes, I would argue that is quite awful.