For the hash file use 2 events.
An on start event using the /hload command.
And an on exit event using the /hsave command.
Theyre both in the help file and really easy to use.

/hload -sbni <name> <filename> [section]
/hsave -sbnioau <name> <filename> [section]
Load or save a table to/from a file.

Sorry, but i dont think i have ever used regex.