Blocking email addresses using profanity filter?

Continuing the discussion from Inappropriate / Obscenity / Profanity Language Filter:

So the profanity filter works well … not that we see it used often.

But is there a way to add regex/patterns so it could block people from putting an email address in a post?

That would be extremely dangerous, though.

“Extremely dangerous” is a strong phrase. Can you say more about why you feel that way?

Etc etc etc

Regex is like a language unto itself. Even a lot of seasoned programmers have trouble with it.

Using it requires not only understanding every possible variation you want to match, but also every possible variation you want to not match.

A lot of people do fairy well with the first, but fail with the second.

For example, using (.)* matches everything, anything, and nothing.
I see it used way too often as a “short cut” to get things to match, but unfortunately it often results in matching what it shouldn’t.

I guess if it were under the “developers only” section it might be enough to scare off Admins that shouldn’t mess with it. But human nature being what it is, give out loaded guns and it’s only a matter of time before someone shoots themselves in their foot.

And as for a valid email regex, it is notoriously difficult to craft a fool-proof one. Many come close and are “good enough” but without additional processing there will likely be problems at some point.

Fair enough, but the filter already exists in Discourse, even if you aren’t using it personally. Also, keep in mind (in response to your blog post) that the Discourse filter doesn’t replace strings, it masks them with squares. :slightly_smiling:

Regexes are inherently difficult, so I’m not necessarily proposing that you ask everyday users to use them as the mainstream use case. The current system works fine for most cases, but there’s no way to surefire way prevent people from posting most common email addresses. (I am not interested in the debate on the “perfect” email regex.)

Meanwhile, I’m simply blocking some of the most common domain names like @gmail.com, @yahoo.com, etc.

I am not interested in letting perfect get in the way of good here. Just trying to prevent the most common occurrences.

Actually, last I knew it replaces the characters with the box decimal value

eg. blocking “@gmail.com”, “someone@gmail.com” would look like

someone■■■■■■■■■■

and the source would be

someone■■■■■■■■■■ 

That is what I meant when I finished the sentence with:

Forgive my error of specificity. What I meant was that it doesn’t replace it with other letters to change the word, as described in the blog post above. :wink:

안녕하세요,

저희 커뮤니티에서 공개 토론 시 이메일 주소를 공유하는 것을 방지하는 데 관심이 있습니다. 개인정보 보호를 위해서인데요(일부 사용자는 저희의 노력에도 불구하고 토론이 공개된다는 사실을 인지하지 못할 수 있거든요?).

이 방식이 적합할까요? 아니면 제가 인지하지 못하고 있는 중대한 리스크가 있을까요?

*@*.com
*@*.org
*@*.net
*@*.edu
*@*.info
*@*.biz

모든 정규식은 상당한 위험을 수반하며, 범위가 넓을수록 위험도 커집니다. 그것들은 꽤 위험합니다.

저의 순진한 희망은 "@"와 최상위 도메인의 포함으로 인해 이메일 주소로만 좁혀지리라는 것이었습니다. 이런 것들을 대상으로 지정할 수 있는 방법이 전혀 없나요?

*.?@gmail.com와 같은 형식이 훨씬 더 안전할 것입니다. 이상적으로는 별표(모든 문자)가 아닌, 알파벳 문자만 허용하는 것이 좋습니다.