Switched to preg_replace_callback
Merge pull request #37 from davibennun/fix_php5.5

Switched to preg_replace_callback for PHP 5.5