6
Aldar
5y

Ugh! Anyone also finds it incredibly annoying that regex notations can change between programs? And I don't mean like PCRE vs jS, those are functional differences.

I mean like... In sed, I always spend trying out all possible combos of backspacing when dealing with special notations like quantifiers {}, sets [], match groups () and so on!

Why can't it be just so that backslash anything = character literal, and not the functional counterpart.

Or at least stick to either one of the options, not like sed, where matchgroup is \(\), quantifier \{\} but a set is just []

Also wish sed supported reluctant quantifier (*?), having to use negative character set matching makes it much less readable...

Comments
  • 3
    Have you ever seen vims regex-engine.
    There you can specify a magic-value, that controls what needs to be escaped and what not.
    It has 4 or 5 setting from "no magic" to "very magic".
  • 1
    @metamourge oh, I use that quite regularly, but only really had one mindblow when I found out you can use a different separator for the individual parts than /, and then don't have to back slash it!

    Really handy for urls.
  • 0
    having used sed, i feel your pain. i tried awk for a while, but awk is a dick. then i tried ripgrep, which is blazingly fast, but unfortunately at the expense of lookahead support. i was seriously about to write my own tool...

    then i found out just about any linux distro has perl.
Add Comment