4 ms·
I feel like one would be much better off and more efficient by just learning regular expressions.
by miked85 6y ago
I feel like one would be much better off and more efficient by just learning regular expressions.
- nerdponx 6y agoI agree. But if you want better readability and comments, Python's "verbose" regex (?x) is a beautiful thing. You can usually also just construct regular expressions incrementally by concatenating strings or whatever your language supports.
- hcarvalhoalves 6y agoThe fact there are countless RegEx cheatsheets and pages like https://regex101.com/ https://regex101.com/ or https://regexr.com/ https://regexr.com/ is evidence RegExes are not intuitive or easy to remember. Composing plain-english functions can be easier to remember, and editors can provide auto-complete.
- ed25519FUUU 6y agoThe argument isn’t that they’re easy to use, it’s that they’re widely used and widely available in virtually all languages. You’ll encounter them. The time it takes to learn regular expressions will pay off because you’ll be reading them and writing them for your whole career.
- king_magic 6y agoEh, not necessarily. 15 years into my career, I can count the number of times I've needed regular expressions on two fingers.
- setr 6y agoExcept that all implementations are subtly and annoyingly different, and while you can transfer your general understanding, you can’t avoid the cheatsheet if you’re using multiple tools. But of course, since this is basically a one-to-one mapping, you can also trivially transfer your understanding to any other regex tool anyways (with a cheatsheet, which you’ll need in either case).
- djeiasbsbo 6y agoI'd say the bigger issue are the different regex implementations. If you use Java, Javascript and grep you already have to know the peculiarities of each implementation...
- flatiron 6y agoIntelliJ at least has a built in regex maker that you can test against strings in the IDE. Pretty close to auto complete.
- pwdisswordfish4 6y agoIt’s only evidence that they have to be learned, like everything else.
- teknopurge 6y agoI love seeing new things and building, I also want to understand why people would find value in this? Is it because people are learning things differently and find this easier to digest instead of using regexs? or native substring tokenization/boolean primitives? The new me is being less critical and positive... (smileyface.jpg)