Help for this page
s{<figr n="([^"]+)">(.*?)</figr>} {'<FIGIND NUM="'.$1.'" ID="FG.'.sprintf("%03d", $1).'">'.$2.'</FIGIND> +'}eg;