3 ms·
OK, you are right, never say never. For a once off, experiment or code never going to prod that you are always going to babysit, a regex is a good solution for
by mianos 5y ago
OK, you are right, never say never. For a once off, experiment or code never going to prod that you are always going to babysit, a regex is a good solution for speed and size of code.
The trouble with most simple regexes to solve this, is the state machine is often not closed.
A regex is way better than strcmp, ltrim, rtrim, mid and friends all held together with gum and tape.