View Single Post
05-04-14, 10:22 AM   #11
Tactica
Not Amused
 
Tactica's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 96
I am posting this to share with others for reference and so others could critique the regex I used to accomplish everything. Maybe someone will find this helpful.

Here is the example code:
Code:
s(544,"Ahn'Kahar Blood Hunter's Battlegear",{50118,50789,50762,50812},4)--544
s(-469,"Ahn'Kahar Blood Hunter'sBattlegear(Lookalike)",50413,49952,50071,50000},nil) --544
s(-470,"Ahn'Kahar Blood Hunter's Battlegear (Lookalike)",{51877,51911,51853,51914},nil) --544
s(-471,"Ahn'Kahar Blood Hunter's Battlegear (Lookalike)",{51002,51566,51325,50789},nil) --544
s(-545,"Ahn'Kahar Blood Hunter's Battlegear (Recolor)",{50979,54577,51151,51153,51914,51935},4)  --544
s(-546,"Ahn'Kahar Blood Hunter's Battlegear (Recolor)",{,51289,50655,50688,50711},4) --544
FYI:
  • Find What:
  • Replace With:
All links take you to regex101 examples!
This was done in Sublime Text 2.

------------------------------------------------------------------------------
  1. Remove duplicate id value: s(1234,1234,
    • (\d+),\1
    • \1
    Here


  2. Comment with their respective ID:
    s(1059,"Amani Mail",{,69561,69590,94216},nil) --1059
    s(-1060,"Amani Mail (Recolor)",{33535,94079,94083,94078},nil) --1059
    • s\((?<!\-)(\d+)(.+\n)(?:((?:s\((?=\-).+\d+\n)+)|(s\((?=\-).+))+
    • s($1$2$3$4 --$1


  3. Fix for above which may produce:
    --1059s(1059,"Amani Mail",{,69561,69590,94216},nil) --1059
    • \s?--.+(?=s\()
    Here


  4. To add --####;Mail after:
    --####
    • (--+.*)
    • \1; Cloth
    Here


  5. To find all comments:
    --1234
    • (--+.*)
    • \1
    Same as above, use Find All


  6. Copy s(####) to --Comment; ####
    • ([a-z]\((\d+).*)
    • \1; \2
    Here



  7. To find s(###) not s(-1234
    • \w\(\d
    Here

Last edited by Tactica : 05-04-14 at 01:46 PM.
  Reply With Quote