Recent Posts
None | 11 sec ago
Python | 26 sec ago
Lua | 39 sec ago
None | 42 sec ago
None | 58 sec ago
None | 1 min ago
None | 1 min ago
C++ | 2 min ago
None | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 10th of Feb 2010 12:24:30 AM
Download |
Raw |
Embed |
Report
function clean_post($post) {
$regex['c'] = '/([\s\w]{2,})/is';
$regex['l'] = '/(\w)\1{2,}/is';
$regex['i'] = '/\[(b|i|u|s|hr|sub|sup|img|media|snapback|spoiler|extract|anchor|twitter)\](.*?)\[\/\1\]/ims';
$regex['n'] = '/\[(url|list|email|topic|post|acronym|blog|entry|member)(?:.*?)\](.*?)\[\/\1\]/ims';
$regex['t'] = '/.*?(?:\[(?P<tag>quote|php|code|html|sql|xml).*?\])(?:.*?)(?:\[\/(?P=tag)\]).*?/ims';
$post = preg_replace($regex['c'], '$1', $post);
$post = preg_replace($regex['l'], '$1', $post);
$post = preg_replace($regex['i'], '$2', $post);
$post = preg_replace($regex['n'], '$2', $post);
while (preg_match($regex['t'], $post, $matches)) {
$post = str_replace($matches[0], '', $post);
}
$points = 0;
$length = strlen($post);
if ($length >= 80 && $length <= 199) {
$points = 1;
} elseif ($length >= 200 && $length <= 399) {
$points = 2;
} elseif ($length >= 400) {
$points = 3;
}
return array($points, $post);
}
Submit a correction or amendment below.
Make A New Post