Jump to content
  • 0
Angelmelody

How to covert this with R.E

Question

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

2 answers to this question

Recommended Posts

  • 0

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 by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

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 by Dastgir Pojee

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.