tried to implement preg_replace_callback() in a way that doesn't make tweetnest incompatible with PHP versions >5.3