Hotfix/hotfix deprecated preg replace

This fixes: http://tracker.modx.com/issues/10056
Please cherry-pick commit 32d0af9