Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I feel like one would be much better off and more efficient by just learning regular expressions.


The fact there are countless RegEx cheatsheets and pages like https://regex101.com/ or 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.


I'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...


IntelliJ at least has a built in regex maker that you can test against strings in the IDE. Pretty close to auto complete.


What is this functionality named?



It’s only evidence that they have to be learned, like everything else.


The 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.


Except 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).


Eh, not necessarily. 15 years into my career, I can count the number of times I've needed regular expressions on two fingers.


I 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)


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: