Skip to content

Instantly share code, notes, and snippets.

@fletom
Created May 22, 2014 04:57
Show Gist options
  • Save fletom/57db5f05b11d2b0acd84 to your computer and use it in GitHub Desktop.
Save fletom/57db5f05b11d2b0acd84 to your computer and use it in GitHub Desktop.
// The Omegle.com "pervy chat" detection algorithm. (From http://www.omegle.com/static/omegle.js.)
function pervy(s) {
return /^\s*f\s*\?\s*$|horny|slut|(?:rub|touch|lick|suck|finger)\s+(?:my|your|ur)|boner|(am|i'm|so|im|my|your?)\s+(hard|wet|tight)|\bcum|sexy|boob|\btits\b|nipple|penis(?:[^e]|$)|cock(?:[^s]|$)|dick(?:[^s]|$)|\bvag(?:\b|ina)|pussy|\bclit|spank|(?:jack|jerk)\s+off|\bfap|nudes|kink/i.test(s);
}
/*
An expanded version of this regex for readability:
/
^\s*f\s*\?\s*$|
horny|
slut|
(?:rub|touch|lick|suck|finger)\s+(?:my|your|ur)|
boner|
(am|i'm|so|im|my|your?)\s+(hard|wet|tight)|
\bcum|
sexy|
boob|
\btits\b|
nipple|
penis(?:[^e]|$)|
cock(?:[^s]|$)|
dick(?:[^s]|$)|
\bvag(?:\b|ina)|
pussy|
\bclit|
spank|
(?:jack|jerk)\s+off|
\bfap|
nudes|
kink
/i
*/
// When it works:
pervy("pm me ur tits pls");
// true
pervy("I live in Scunthorpe, England. And yourself?")
// false
// When it doesn't work:
pervy("I just found the immigration process so cumbersome.");
// true
pervy("It's so wet outside.");
// true
pervy("I'm tight for money these days, sorry!");
// true
pervy("I'm rock hard now. I wish I could fuck your dirty little cunt.");
// false
pervy("I really wanna tongue your asshole while you masturbate for me.");
// false
pervy("Let's have cyber sex.");
// false
// Note: this is not intended as an insult to the developer who spent two minutes writing that regex.
// I just came across it while reading the Omegle source code and found it to be mildly amusing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment