VegOwOtenks@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 年前Regex flavorslemmy.worldexternal-linkmessage-square9fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkRegex flavorslemmy.worldVegOwOtenks@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 年前message-square9fedilink
minus-squarejaybone@lemmy.worldlinkfedilinkarrow-up0·2 年前Can you actually name capture groups, or this means how you can refer to them by number?
minus-squareVegOwOtenks@lemmy.worldOPlinkfedilinkarrow-up0·2 年前You can use backreferences \1 \2 etc. but you can also give them names explicitly. it looks like this: (?<name>inner-regex) Some flavors support it, kotlins doesn’t apparently.
Can you actually name capture groups, or this means how you can refer to them by number?
You can use backreferences
\1 \2etc. but you can also give them names explicitly.it looks like this:
(?<name>inner-regex)Some flavors support it, kotlins doesn’t apparently.
TIL thanks!