เมนูนำทาง
แม่แบบ:Bots Implementationfunction allowBots( $text ) { global $user; if (preg_match('/\{\{(nobots|bots\|allow=none|bots\|deny=all|bots\|optout=all|bots\|deny=.*?'.preg_quote($user,'/').'.*?)\}\}/iS',$text)) { return false; } return true;}
sub allowBots { my($text, $user, $opt) = @_; return 0 if $text =~ /{{nob[o]ts}}/; return 1 if $text =~ /{{b[o]ts}}/; if($text =~ /{{bots\s*\|\s*allow\s*=\s*(.*?)\s*}}/s){ return 1 if $1 eq 'all'; return 0 if $1 eq 'none'; my @bots = split(/\s*,\s*/, $1); return (grep $_ eq $user, @bots)?1:0; } if($text =~ /{{bots\s*\|\s*deny\s*=\s*(.*?)\s*}}/s){ return 0 if $1 eq 'all'; return 1 if $1 eq 'none'; my @bots = split(/\s*,\s*/, $1); return (grep $_ eq $user, @bots)?0:1; } if(defined($opt) && $text =~ /{{bots\s*\|\s*optout\s*=\s*(.*?)\s*}}/s){ return 0 if $1 eq 'all'; my @opt = split(/\s*,\s*/, $1); return (grep $_ eq $opt, @opt)?0:1; } return 1;}
public static bool AllowBots(string text, string user){ return !Regex.Match(text, @"\{\{(nobots|bots\|(allow=none|deny=.*?" + user.Normalize() + @".*?|optout=all|deny=all))\}\}", RegexOptions.IgnoreCase).Success;}
public static boolean AllowBots(String text, String user){ return !Regex.Match(text, "\\{\\{(nobots|bots\\|(allow=none|deny=.*?" + user.Normalize() + ".*?|optout=all|deny=all))\\}\\}", RegexOptions.IgnoreCase).Success;}
def Allowbots(text, user): if (re.search(r'\{\{(nobots|bots\|(allow=none|deny=.*?' + user + r'.*?|optout=all|deny=all))\}\}', text)): return false return true
เมนูนำทาง
แม่แบบ:Bots Implementationใกล้เคียง
แม่แบบ แม่แตงร่มใบ แมน-แบท แม่บ้านบัตเตอร์สกอตช์ แม่ของแผ่นดิน แม่แจ่ม แม่บ้านลึกลับกับครอบครัวอลเวง แม่แตง แซ่แบ้ แม่บ้าน (แก้ความกำกวม)แหล่งที่มา
WikiPedia: แม่แบบ:Bots