• frezik@midwest.social
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      4 months ago

      I don’t. It may look less like line noise, but it doesn’t unravel the underlying complexity of what it does. It’s just wordier without being helpful.

      https://www.wumpus-cave.net/post/2022/06/2022-06-06-how-to-write-regexes-that-are-almost-readable/index.html

      Edit: also, these alternative syntaxes tend to make some easy cases easy, but they have no idea what to do with more complicated cases. Try making nested capture groups with these, for instance. It gets messy fast.

      • JoeyJoeJoeJr@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        it doesn’t unravel the underlying complexity of what it does… these alternative syntaxes tend to make some easy cases easy, but they have no idea what to do with more complicated cases

        This can be said of any higher-level language, or API. There is always a cost to abstraction. Binary -> Assembly -> C -> Python. As you go up that chain, many things get easier, but some things become impossible. You always have the option to drop down, though, and these regex tools are no different. Software development, sysops, devops, etc are full of compromises like this.

        • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          Exactly, at the end of the day it’s about using the right tool for the job. Code that’s clear and declarative is easier to maintain, so it makes sense to default to it, but nothing stops you from using low level constructs if you really need to.

  • jaybone@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Can you actually name capture groups, or this means how you can refer to them by number?

  • itsathursday@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Named groups are nice but can I please define a group more than once because maybe I want to group my data and consolidate values in a logical way without you complaining I have already used a group previously. I know I did, I’m the one telling you, now capture it twice!

  • neidu2@feddit.nl
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    I don’t see the problem. But that’s probably because my goto-language is perl.