How to covert this with R.E

Angelmelody

(\ /) ( . .)
Messages
772
Points
0
Age
32
Location
new_1-1,53,111
Github
Angelmelody
Emulator
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)

 
Without regex, its possible, search

pc_readglobalreg(sd,"

replace with

pc_readglobalreg(sd,script->add_str("

you can do same with tsd and setglobalreg.

 
Last edited by a moderator:
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)

 

 
Last edited by a moderator:
Back
Top