removed preg_replace with /e modifier

switched from using preg_replace with /e as it's deprecated in 5.5 and not supported in some environments;
while an anonymous function would work, by using create_function we can stay 5.2 compatible;
necessary for Google App Engine compatibility;