VegOwOtenks@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agoRegex flavorslemmy.worldexternal-linkmessage-square9fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkRegex flavorslemmy.worldVegOwOtenks@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agomessage-square9fedilink
minus-squarejaybone@lemmy.worldlinkfedilinkarrow-up0·2 years agoCan you actually name capture groups, or this means how you can refer to them by number?
minus-squareVegOwOtenks@lemmy.worldOPlinkfedilinkarrow-up0·2 years agoYou 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!