Rsyslog syntax error on token ‘regex’ / ‘ereregex’

Use re_match. http://www.rsyslog.com/doc/master/rainerscript/functions.html?highlight=re_match

if ( $fromhost-ip startswith '10.0.0' and re_match($hostname,'.*-fw[0-9]') ) then
  action(type="omfile" file="/tmp/test.log")