4 ms·
Never is a strong word. If I have a data file that I'm not going to use very much I'm definitely going to write 10 lines of python using re.find and string.find
by rockemsockem 5y ago
Never is a strong word. If I have a data file that I'm not going to use very much I'm definitely going to write 10 lines of python using re.find and string.find to get what I want out of it.
Unless you have some nice way to quickly create a state machine besides using regexes?
- mianos 5y agoOK, 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.