>> This looks useful, but I think it wou=
ld be even better to add it
>> as a pcase macro to be composable (see attached patch).=C2=A0
Hey, very nice.=C2=A0 Please add it to rx.el.
[ But please change `backref-var` to just `backref` (you can distinguish
=C2=A0 the two based on the type of the argument, I think).=C2=A0 I guess o=
ne
=C2=A0 could also argue that you could similarly rename the `let` to
=C2=A0 `group-n`.=C2=A0 ]
Pushed as ad4eff3b905dbc32e2d38bfec1e4f93eceec288d. I've renamed back=
ref-var to backref as you suggested, but left `let' because I think tha=
t feature is important enough to deserve a short, common name.
=C2=A0
> Although, i must admit i am not fluent in `rx' syntaxis, i find yo=
ur idea
> very nice.
If you prefer the standard/cryptic regexp syntax, I posted a similar
thingy in the past (see below).
This lets you do
=C2=A0 =C2=A0 (pcase "foo-123"
=C2=A0 =C2=A0 =C2=A0 ((re-match "[[:alpha:]]+-\\(?num:[0-9]+\\)")=
=C2=A0 =C2=A0 =C2=A0 =C2=A0num))
=C2=A0 =C2=A0 =3D> "123"
Maybe I should install it in pcase.el?
Sure! I'd suggest to change the sy=
ntax to be compatible with other languages:
\(?<=
;abc>[0-9]+\) or \(?'abc'[0-9+\) (Perl and .NET)
\(?P&=
lt;abc>[0-9]+\) (Python)
These languages also h=
ave syntax for named backreferences, though that's less important.=C2=
=A0
--001a1140faba7be2880555022058--