Angelmelody 221 Posted April 7, 2014 Who can convert the format syntaxes with regular expression 1. pc_readglobalreg(sd,"xxxxxxx") pc_readglobalreg(tsd,"xxxxxxx") ↓ pc_readglobalreg(sd,script->add_str("xxxxxxx")) pc_readglobalreg(tsd,script->add_str("xxxxxxx")) 2. pc_setglobalreg (sd, "xxxxxxx", yyyyyyyyyyy) pc_setglobalreg (tsd, "xxxxxxx", yyyyyyyyyyy) ↓ pc_setglobalreg (sd, script->add_str("xxxxxxx"), yyyyyyyyyyy) pc_setglobalreg (tsd, script->add_str("xxxxxxx"), yyyyyyyyyyy) Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted April 7, 2014 (edited) Without regex, its possible, search pc_readglobalreg(sd," replace with pc_readglobalreg(sd,script->add_str(" you can do same with tsd and setglobalreg. Edited April 7, 2014 by Dastgir Pojee Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 7, 2014 (edited) Without regex, its possible, search pc_readglobalreg(sd," replace with pc_readglobalreg(sd,script->add_str(" you can do same with tsd and setglobalreg. Thanks ,but I wanna create a notepate++ macro to convert old format to herc format for exmaple I did a class update macro for this <Macro name="item_db Class Update" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(0x[a-zA-Z0-9]*),2,([0-9]+)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="1,18,2" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> so I think regular expression is my best choice ok I spend 1 hour to learn basic R.E , finally I figure out by myslef 1. (pc_readglobalreg*[(]*[[a-zA-Z]**),([^,]*)) 1,script->add_str(2)) 2. (pc_setglobalreg[^,]*),([^,]*),([^,]*)) 1, script->add_str(2),3) Edited April 9, 2014 by Angelmelody 1 milk reacted to this Quote Share this post Link to post Share on other sites
Who can convert the format syntaxes with regular expression
1.
pc_readglobalreg(sd,"xxxxxxx")
pc_readglobalreg(tsd,"xxxxxxx")
↓
pc_readglobalreg(sd,script->add_str("xxxxxxx"))
pc_readglobalreg(tsd,script->add_str("xxxxxxx"))
2.
pc_setglobalreg (sd, "xxxxxxx", yyyyyyyyyyy)
pc_setglobalreg (tsd, "xxxxxxx", yyyyyyyyyyy)
↓
pc_setglobalreg (sd, script->add_str("xxxxxxx"), yyyyyyyyyyy)
pc_setglobalreg (tsd, script->add_str("xxxxxxx"), yyyyyyyyyyy)
Share this post
Link to post
Share on other sites