replace some preg_replace by preg_replace_callback (refs #4125)
Merge pull request #966 from Eric-Brison/3.2-E4125

replace some preg_replace by preg_replace_callback (closes #4125)