Wednesday, February 6, 2019

Regular Expression Replace in Notepad++

Notepad++ can search strings and replace them using regular expression
Regular_Expression (Wikipedia)
it can be use to :-
1. generate a huge list of mapflags
2. fix outdated format on the script commands
3. apply a quick fix on CVS style database
4. convert client side item list into array




Example 1. Generate a huge list of mapflags


1. goto db/map_index.txt, copy over the map list

2. there are some lines commented, so find the line with // and remove them by doing this
Find with regular expression Replace with empty string, this effectively leave the line blank

3. Edit -> Line Operations -> Remove Empty lines

4. Find with regular expression Replace with


Example 2. Fix outdated format on the script commands


Find with regular expression Replace with

Example 3. Apply a quick fix on CVS style database

rathena only, Hercules has switched to libconfig format
goto db/re/item_db.txt

Find with regular expression Replace with Find with regular expression Replace with Find with regular expression Replace with


Example 4: Convert client side item list into array

goto kro/data/cardprefixnametable.txt

Find with regular expression Replace with


External Links:

Disable dead branch (Example 1) 
Convert pow(a,b) into a**b (Example 2)
Swap item type IT_ARMOR and IT_WEAPON (Example 3)
getitemname2 function (Example 4)

No comments:

Post a Comment

Linux compiler error that never shown on Visual Studio

let's just admit Visual Studio sux ... ok ? right now, if you want to host a Private Ragnarok Online server, its just better to choose...