简体   繁体   English

使用 C# 检测文本中的电子邮件和社交媒体帐户

[英]Detecting emails and social media accounts in text with C#

I am creating some kind of social platform that people have to pay to use it.我正在创建某种社交平台,人们必须付费才能使用它。 I am supposed to not allow anyone to write their email address, social media account username (eg Instagram username) or their phone number).我不应该允许任何人写下他们的电子邮件地址、社交媒体帐户用户名(例如 Instagram 用户名)或他们的电话号码。

Scanning every single profile update manually will be a cumbersome and costly operation so I am thinking of a way to find and remove such contact details, at least to some extent.手动扫描每个个人资料更新将是一项繁琐且成本高昂的操作,因此我正在考虑一种方法来查找和删除此类联系方式,至少在某种程度上是这样。

I have used regext to find the @ character but that will not really work as users can easily ignore the @ character!我已经使用 regext 来查找 @ 字符,但这不会真正起作用,因为用户很容易忽略 @ 字符!

Is there a library that I can use for this porpuse?有没有我可以用于这个豪猪的图书馆?

Just like @Robert Harvey noted, it's a pretty hopeless task.就像@Robert Harvey 指出的那样,这是一项非常无望的任务。

Some recommendations you can use:您可以使用的一些建议:

  1. Filter out any profiles that contains url matches to a social site.过滤掉任何包含与社交网站匹配的 url 的配置文件。 Or disallow links in general.或者一般禁止链接。
  2. Filter out only the profiles that mention the names/name shortcuts to social sites, that way you'll have a lot less work.仅过滤掉提及社交网站名称/名称快捷方式的配置文件,这样您的工作就会少很多。
  3. At the place where users can enter such unneeded details you could put a large disclaimer that linking to any social media in anyway is prohibited and can result in account suspension.在用户可以输入此类不需要的详细信息的地方,您可以放置​​一个大的免责声明,即禁止以任何方式链接到任何社交媒体,并可能导致帐户暂停。
  4. You can filter out profiles which have a sequence of numbers in a row(ignoring spaces/dashes) to find phone numbers.您可以过滤掉具有连续数字序列的配置文件(忽略空格/破折号)以查找电话号码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM