Hotfix/hotfix deprecated preg replace

This fixes: http://tracker.modx.com/issues/10056
** Sorry about the 3 empty commits in this pull.. you can just cheery-pick the last one edbe094,   I'm not sure why git did this mess...  Thanks.