Originally Posted by ravagernl
|
I am a lil confuzzled. Sorry if I am such a nub at these expressions...
http://regex101.com/r/mR2fG3 = [a-z]\((\d+) and \w[(]\d+ which both capture the same "s(1759" when I need just the "1759" Also, this is for regexp future reference.
Still trying to figure out how to copy all the different line values, i.e. "s(
1759", "s(
892" etc. etc. throughout the entire ST2 document and
then paste them at the end of their respective line. Any suggestion as to the proper method?
EDIT:
Code:
local comment, group
print((([[
s(1759,"B 1",{99168,99157,99158,99159,105779,105792},4)
s(-1764,"B 2 (L)",{105819,105140,104956,105141,105086,105119},nil)
s(-1763,"B 3 (R)",{99086,99080,99081,99082,105086,105119},4)
s(-1762,"B 4 (L)",{105432,105638,105454,105639,105584,105617},nil)
s(-1761,"B 5 (R)",{99406,99402,99403,99404,105584,105617},4)
s(-1760,"B 6 (L)",{105183,105809,105754,105800,105779,105792},nil)
s(1753,"C",{105161,99108,99109,99104,105784,105790},64)
s(-1755,"C (R)",{105410,99352,99353,99354,105597,105598},64)
s(-1754,"C (L)",{105329,105161,105259,105404,105755,105784,105790},nil)
]]):gsub('(s%((.-),"(%w+).-)\n',
function(line, next_comment, next_group)
if group ~= next_group then
group = next_group
comment = next_comment
end
return line..' -- '..comment..'\n'
end
)))
^ Works somewhat. It matches s(1629,"Plate of the All-Consuming Maw" with the same itemset# (1629) as s(1458,"Plate of Resounding Rings" due to the "Plate" name.