4 ms·
As a lead developer, I frown upon every instance of regex used. If it's shorter then, say, 20 characters, it may be allowed. Longer then that will result in a n
by sharpercoder 8y ago
As a lead developer, I frown upon every instance of regex used. If it's shorter then, say, 20 characters, it may be allowed. Longer then that will result in a negative advice and binding advice to refactor. You implement a language lexer & parser, or use plain string functions.
- devxpy 8y agoYou might be interested in the parse python library https://github.com/r1chardj0n3s/parse https://github.com/r1chardj0n3s/parse
- jonathanyc 8y agoI’d expect you, “as a lead developer,” to know how the tokenizer in your lexer almost certainly works. Rather than frowning upon “every instance of regex used,” I’d expect you to be familiar with cleaner and more maintainable ways of writing regexes, which are, after all, just declarative ways of specifying finite automata. An NFA is infinitely easier to characterize than some mess of a hand written recursive descent parser, precisely because they are so restricted.
- paulddraper 8y agoOn contrary, I find sed quite valuable.