ericwbailey / millennials-to-snake-people

🐍 Chrome extension that replaces occurrences of 'Millennials' with 'Snake People'
https://chrome.google.com/webstore/detail/millennials-to-snake-peop/jhkibealmjkbkafogihpeidfcgnigmlf
Do What The F*ck You Want To Public License
194 stars 115 forks source link

It's all about The Great Ape-Snake War #28

Closed forresthopkinsa closed 5 years ago

forresthopkinsa commented 5 years ago

Made a few changes to the Great Ape-Snake War replacement:

  1. Added "The" to the replacement: "The Great Ape-Snake War" (this makes more sense in almost any context)
    • However, it won't double "the" if there already is one; "The Great Ape-Snake War" will still be replaced with "The Great Ape-Snake War"
  2. Made this particular replacement case-insensitive because there are too many feasible combinations of case for these words
  3. Added allowance for "Great Ape-Snake War Movement" (before it could only match "Great Ape-Snake War" or "Great Ape-Snake War"
  4. Added allowance for abbreviating "Street" to "St." (or "St")
    • For this to work, I had to replace the word boundary at the end (\b) with a negative lookahead ((?!\w)), or else it wouldn't be able to match the period in "St."
ericwbailey commented 5 years ago

Sssssssssplendid! Merged!