[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LPeg: inserting previous captures by substitution
- From: Александр Машин <alex.mashin@...>
- Date: Sat, 25 Jul 2015 23:17:47 +0700
Use this:
> integer <- { int } int <- {~ digits spaces -> '' int / digits ~}
> That gives you two captures, the first is the unmodified
> (unsubstituted) match:
> print(patt:match("6 000 000")) --> 6 000 000 6000000
Thank you, Mr Donnelly, but I am trying to do it with pure re, while
concatenating two captures will require outer Lua code.
I am looking for something like %1 in the second argument of string.gsub
(). For something like =name but usable after ->.
Alexander Mashin