Skip to content

Instantly share code, notes, and snippets.

@ndarville ndarville/README.md
Last active Dec 13, 2015

Embed
What would you like to do?
Star Wars: The Force Awakens spoiler filter

Star Wars: The Force Awakens Filter

This is a basic regular expression (pattern-matching script) to detect, and ideally filter, all things Star Wars, be it to avoid spoilers, or just everything Star Wars.

To see the filter in action, go to this demo. To read more about the filter and get the Tweetbot mute filter, go to the blog post.

The word list contains a list of some characters and actors. Depending on your degree of blackout, you may consider some of them spoilers. I personally do not, but I can set up a separate page with just the Tweetbot link to protect your innocence.

License

MIT seems like the most permissive, so let’s use that one for now.

Word List

  • Maz Kanata
  • Han Solo, Harrison Ford+
  • Leia, Carrie Fisher+
  • Skywalker, Hamill+
  • Chewbacca, Chewie, Wookie(e), Mayhew+
  • Kylo, Adam Driver+
  • Daisy Ridley+
  • Boyega+
  • Abrams+, JJA+, J.J.A.+, J. J. A.+
  • (General) Hux, Domhnall+, Gleeson+
  • (Captain) Phasma, Gwendoline (Christie)+
  • Vader, Darth - sorry, @darth
  • Snoke
  • R2-D2
  • C3PO
  • Lor San, Tekka, (Max von) Sydow+
  • BB-8
  • (Poe) Dameron, Oscar Isaac+

  • Star Wars, Force Awakens
  • Lightsaber
  • Jedi
  • Stormtrooper
  • Millennium Falcon

+ Refers to a filter based on the actor/director’s real name. You may not want to include this, if you want to follow the person—while risking the spoiler. You may have wondered why Lupita Nyong’o is not on the list. Go figure.

(?i)\b(Maz( )?Kana(a)?ta|Han( )?Solo|Har(r)?ison( )?Ford|Leia|Carrie( )?Fisher|Skywalker|Hamill|Chewbacca|Chewie|Wookie|Mayhew|Kylo|Adam( )?Driver|Daisy( )?Ridley|Boyega|Abrams|J(\.)?( )?J(\.)?( )?(A)?(\.)?( )?|Hux|Domhnall|Gleeson|Phasma|Gwendoline|Vader|Darth|Snoke|R2(\-)?D2|C3PO|Lor( )?San|Tekka|Sydow|BB(\-)?8|Dameron|Oscar( )?Isa(a)?c|Star( )?War(s)?|Force( )?Awakens|Light( )?saber|Jedi|Storm( )?trooper|Millennium( )?Falcon)

tweetbot:///mute/keyword?regex=1&text=(%3Fi)%5Cb(Maz(%20)%3FKana(a)%3Fta%7CHan(%20)%3FSolo%7CHar(r)%3Fison(%20)%3FFord%7CLeia%7CCarrie(%20)%3FFisher%7CSkywalker%7CHamill%7CChewbacca%7CChewie%7CWookie%7CMayhew%7CKylo%7CAdam(%20)%3FDriver%7CDaisy(%20)%3FRidley%7CBoyega%7CAbrams%7CJ(%5C.)%3F(%20)%3FJ(%5C.)%3F(%20)%3F(A)%3F(%5C.)%3F(%20)%3F%7CHux%7CDomhnall%7CGleeson%7CPhasma%7CGwendoline%7CVader%7CDarth%7CSnoke%7CR2(%5C-)%3FD2%7CC3PO%7CLor(%20)%3FSan%7CTekka%7CSydow%7CBB(%5C-)%3F8%7CDameron%7COscar(%20)%3FIsa(a)%3Fc%7CStar(%20)%3FWar(s)%3F%7CForce(%20)%3FAwakens%7CLight(%20)%3Fsaber%7CJedi%7CStorm(%20)%3Ftrooper%7CMillennium(%20)%3FFalcon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.