Skip to content

Instantly share code, notes, and snippets.

@paceaux
Last active April 30, 2025 15:55
Show Gist options
  • Save paceaux/025d6604b214ecfd91a4ead9a894fc5c to your computer and use it in GitHub Desktop.
Save paceaux/025d6604b214ecfd91a4ead9a894fc5c to your computer and use it in GitHub Desktop.
profanity-regex
const profanityRegex = /(((\b|\w+)?(fuck|shit|dick|twat|cock|douche|bitch|piss)(\w+|\b))|((\w+|\b)ass?(\b|hole|face|clown))|((\b)cunt(\w+|\b)))/
@paceaux
Copy link
Author

paceaux commented Apr 30, 2025

/((\b|\w+)?(fuck|shit|dick|twat|cock|douche|bitch)(\w+|\b))/ would capture infixes such as
absofuckinglutely and enshittification, as well as initials like twatwaffle, douchecanoe.

/((\w+|\b)ass)?\b/ captures standalone ass and ass suffixes

((\w+|\b)ass?(\b|hole|face|clown)) captures standalone ass, ass prefixes, and asshole / face

/((\b)cunt(\w+|\b))/ captures an initial cunt and allows for plurals, comparatives, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment