React.pl uses a file ~/.weechat/react which is like this:
### WeeChat react.pl rules ### -irc-in "^:\\*status!znc\@znc.in PRIVMSG MyNick.* :(.*)" -suppress -command "/echo -c -b $server znc: $1" -print regex -command /cmd
It extracts the file of rules where each rule line consists of:
type of hook (-print / -signal / -modifier / -irc-in)
-cond condition for hook to react, eg. for hook_modifier it's a regexp
action: