Raised This Month: $ Target: $400
 0% 

REGEX Word Filter


Post New Thread Reply   
 
Thread Tools Display Modes
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 02-09-2014 , 22:58   Re: REGEX Word Filter
Reply With Quote #121

Ok, here's a wierd RegEx request ... which happens to be why I am considering putting filtering into my servers at all ....

Telephone numbers?

I had an issue with a player say stuff like "I am {insert-offense-phrase-here}, call me at (800)-555-1212" or something like that. Normally, I am not big on censoring what people put into chat on my servers. However, I am worried that it's (presumably) not their own phone number, and instead they are basically encouraging crank phone-calls.

Ideally, to cover these formats:
  • +1(###) ###-####
  • +1(###)###-####
  • (###) ###-####
  • (###)###-####
  • (###)#######
  • ###-###-####
  • ###-#######
  • ##########
  • +1(###) ###.####
  • +1(###)###.####
  • (###) ###.####
  • (###)###.####
  • ###.###.####
  • ###.#######
  • +1(###) ### ####
  • +1(###)### ####
  • (###) ### ####
  • (###)### ####
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 02-09-2014 at 22:59.
Weasel is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 02-10-2014 , 00:53   Re: REGEX Word Filter
Reply With Quote #122

Quote:
Originally Posted by Weasel View Post
Is it possible to use comments in the configuration file, prefixed by "//"?
Never-mind. Apparently comments may be incorporated into the configuration file, prefixed by "//". I am using that in my configuration file now, without any issues. Just didn't see it documented anywhere.
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 02-10-2014 at 00:57.
Weasel is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 02-10-2014 , 00:56   Re: REGEX Word Filter
Reply With Quote #123

Quote:
Originally Posted by Weasel View Post
Ok, here's a wierd RegEx request ... which happens to be why I am considering putting filtering into my servers at all ....

Telephone numbers?

I had an issue with a player say stuff like "I am {insert-offense-phrase-here}, call me at (800)-555-1212" or something like that. Normally, I am not big on censoring what people put into chat on my servers. However, I am worried that it's (presumably) not their own phone number, and instead they are basically encouraging crank phone-calls.
Never-mind. I did some Google-ing around and found several regex's. Not sure if I really need all of them, but I put them all into my configuration - which is probably way redundant. Sample below:
Code:
	"BlockPhoneNumbers"
	{
		"chatpattern"		"(?:\+?1[-. ]?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})"
		"chatpattern"		"/\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/"
		"chatpattern"		"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$"
		"warn"			"Do NOT put phone numbers into chat!"
		"block"			"1"
		"action"		"sm_silence #%u"
	}
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 02-10-2014 at 00:57.
Weasel is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 06-23-2014 , 17:45   Re: REGEX Word Filter
Reply With Quote #124

Is there any option to "prefix" the existing message with something - instead of "replace" words it?
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter
Weasel is offline
jpwanabe
Veteran Member
Join Date: Mar 2010
Old 06-25-2014 , 21:38   Re: REGEX Word Filter
Reply With Quote #125

Sooo. Does anyone know if this works in tf2 correctly. Last time I tried it I got spammed with errors. Or does anyone know of a plugin like this but kept up to date?
__________________
My Steam TF2APP
My sig changes with each load! Refresh to see my other servers!

Last edited by jpwanabe; 06-25-2014 at 21:38.
jpwanabe is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 06-25-2014 , 23:47   Re: REGEX Word Filter
Reply With Quote #126

Quote:
Originally Posted by jpwanabe View Post
Sooo. Does anyone know if this works in tf2 correctly. Last time I tried it I got spammed with errors. Or does anyone know of a plugin like this but kept up to date?
I am using it on my TF2 servers right now. The only time I had a problem, was when I had (accidentally) multiple expressions that kept trying to replace each other.
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter
Weasel is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 08-10-2014 , 21:33   Re: REGEX Word Filter
Reply With Quote #127

Anybody know if this can be used to replace double-quot character (") with single-quote/apostrophe character (')? I tried this and it didn't work - maybe it doesn't recognize octal regex escapes?
Code:
	"ReplaceDoubleQuotes"
	{
		"chatpattern"   "\43"
		"replace"       "\47"
	}
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 08-10-2014 at 21:33.
Weasel is offline
TomXPro
Senior Member
Join Date: Aug 2014
Location: Germany
Old 08-23-2014 , 19:21   Re: REGEX Word Filter
Reply With Quote #128

Is it possible to filter Player Names with it?
TomXPro is offline
kAKAN
Junior Member
Join Date: Aug 2014
Old 08-24-2014 , 09:57   Re: REGEX Word Filter
Reply With Quote #129

Any chance of making this plugin compatible with this? https://forums.alliedmods.net/showpo...68&postcount=4
We already have HUGE file with a lot of regex lines, I really don't want to sit for weeks to rewrite the whole file
kAKAN is offline
EMINEM_FB
Senior Member
Join Date: Dec 2010
Location: Czech republic
Old 08-29-2014 , 12:32   Re: REGEX Word Filter
Reply With Quote #130

when will be csgo version ?
EMINEM_FB is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode