• jaybone@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    2 months ago

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

    • mormund@feddit.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      In modern languages you can name them with labels as well yes. Not sure about the syntax right now. Something like (?label:…) I think

      • qaz@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 months ago

        It’s (?<NAME>...) and those are the named capture groups referred to in the post.