Browse Source

Merge pull request 'relax slur filter' (#322) from layla/lemmy-hexbear:feature/relax-slurfilter into main

Reviewed-on: https://git.chapo.chat/hexbear-collective/lemmy-hexbear/pulls/322
main v0.8.0.hex
DashEightMate 1 month ago
parent
commit
caa2884cd5
  1. 2
      server/lemmy_utils/src/lib.rs

2
server/lemmy_utils/src/lib.rs

@ -330,7 +330,7 @@ lazy_static! {
static ref EMAIL_REGEX: Regex = Regex::new(r"^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-][email protected][a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$").unwrap();
static ref PII_REGEX: Regex = Regex::new(r"(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}").unwrap();
static ref MD_IMAGE_REGEX: Regex = Regex::new(r"!\[[\s\S]*?\]\([\s\S]*?\)").unwrap();
static ref SLUR_REGEX: Regex = RegexBuilder::new(r"([^\p{P}\s]*?(f(a|4)g(got|g)?){1,}|maricos?|(n(i|1|a|4|e|l)gg((a|er)?(s|z)?)){1,}|(nig){2,}|dindu(s?){1,}|mudslime?s?|(k(i|y|1|l)kes?){1,}|(mongoloids?){1,}|(towel\s*heads?){1,}|\bspi(c|k)s?\b|(spi(c|k)s){2,}|\bchinks?|(ch(i|1)nks?){1,}|(n(i|1|l)glets?){1,}|be(a|@|4)ners?|\bjaps?\b|(japs){2,}|\bcoons?\b|(coons?){2,}|(jungle\s*bunn(y|ies?)){1,}|(jigg?aboo?s?){1,}|\bpakis?\b|(pakis?){2,}|(rag\s*heads?){1,}|(gooks?){1,}|(cuntboy?){1,}|(feminazis?){1,}|\btr(a|@)nn?(y|(i|1|l)es?|ers?)|(tr(a|@)nn?(y|(i|1|l)es?|ers?)){1,}|(l(a|@|4)dyboy(s?)){1,}|ret(a|4)rd(s|ed)?|(hymie){1,}|(porch\s?monkey){1,}|(zh(y|i)d(ovka)?){1,}|\bching\s?chong\b|(ching\s?chong\s?){1,}|(chong\s?ching\s?){1,}|(hefem(a|@|4)le){1,}|(dickgirl){1,}|(hermie){1,}|(\babb?o\b)|(abb?o){2,}|(boong){1,}|(cunts?){1,}|(d(y|i|l)kes?){1,}|(shem(en|an|ales?))|(chinam(an|en))|(fut(a|4)(nar(i|l))?)|(redsk(i|l)ns?)|(slanteyes?)|(degen(s|era(tes?|cy)))|(curry\s?munchers?))").case_insensitive(true).build().unwrap();
static ref SLUR_REGEX: Regex = RegexBuilder::new(r"([^\p{P}\s]*?(f(a|4)g(got|g)?){1,}|maricos?|(n(i|1)gg((a|er)?(s|z)?)){1,}|(nig){2,}|dindu(s?){1,}|mudslime?s?|(k(i|y|1|l)kes?){1,}|(mongoloids?){1,}|(towel\s*heads?){1,}|\bspi(c|k)s?\b|(spi(c|k)s){2,}|\bchinks?|(ch(i|1)nks?){1,}|(n(i|1|l)glets?){1,}|be(a|@|4)ners?|\bjaps?\b|(japs){2,}|\bcoons?\b|(coons?){2,}|(jungle\s*bunn(y|ies?)){1,}|(jigg?aboo?s?){1,}|\bpakis?\b|(pakis?){2,}|(rag\s*heads?){1,}|(gooks?){1,}|(cuntboy?){1,}|(feminazis?){1,}|\btr(a|@)nn?(y|(i|1|l)es?|ers?)|(tr(a|@)nn?(y|(i|1|l)es?|ers?)){1,}|(l(a|@|4)dyboy(s?)){1,}|ret(a|4)rd(s|ed)?|(hymie){1,}|(porch\s?monkey){1,}|(zh(y|i)d(ovka)?){1,}|\bching\s?chong\b|(ching\s?chong\s?){1,}|(chong\s?ching\s?){1,}|(hefem(a|@|4)le){1,}|(dickgirl){1,}|(hermie){1,}|(\babb?o\b)|(abb?o){2,}|(boong){1,}|(cunts?){1,}|(shem(en|an|ales?))|(chinam(an|en))|(redsk(i|l)ns?)|(slanteyes?)|(degen(s|era(tes?|cy)))|(curry\s?munchers?))").case_insensitive(true).build().unwrap();
static ref USERNAME_MATCHES_REGEX: Regex = Regex::new(r"/u/[a-zA-Z][0-9a-zA-Z_]*").unwrap();
// TODO keep this old one, it didn't work with port well tho
// static ref MENTIONS_REGEX: Regex = Regex::new(r"@(?P<name>[\w.]+)@(?P<domain>[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)").unwrap();

Loading…
Cancel
Save