Skip to content

Instantly share code, notes, and snippets.

@paceaux
Created January 6, 2023 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paceaux/87f615415a6850d32fa1fbd03fbe600f to your computer and use it in GitHub Desktop.
Save paceaux/87f615415a6850d32fa1fbd03fbe600f to your computer and use it in GitHub Desktop.
Pronoun Regexes
const masculinePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))', 'gi');
const femininePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))','gi');
/*
English: she, her, hers, herself
French: elle, elle-même, son, sa
Spanish: ella, su, ella misma
Portuguese: ela, sua, ela mesma
English: he, him, his, himself
French: il, lui, son, lui-même
Spanish: él, él mismo el mismo
Portuguese: ele, ele mesmo
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment