[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Backreferences in rex.gsub
- From: Aaron Brown <arundelo@...>
- Date: Thu, 2 Sep 2010 12:40:30 -0400
> I'm trying to access a backreference (via %1) captured in
> parenthesis, as shown below:
>
> value = rex.gsub(value, "(?:(.{2,})%1{32,})", "x", nil, 0, 0);
>
> What is the correct syntax for accessing captured data in
> rex.gsub?
I don't think I've used this library, but both POSIX and
PCRE regexes use backslash-digit for backreferences (the
backslash is doubled below to escape its magic meaning
inside the double-quoted string literal):
value = rex.gsub(value, "(?:(.{2,})\\1{32,})", "x", nil, 0, 0)
--
Aaron
http://arundelo.com/