Eliminate extra exclamation points!!!

I’m not militant about punctuation but i do find it annoying when people write things with lots of exclamation points. So i created a Greasemonkey script that turns anything more than two exclamation points into just one. Greasemonkey has to be installed and you need to be using Firefox in order for this to work. If you have them both already then grab my excessive exclamation points script. There is some excessive punctuation below for you to test. After you have installed the script just refresh this page and you should see the exclamation points disappear from this post’s title and the lines below.

Two exclamation points!!
Ten exclamation points!!!!!!!!!!
Five exclamation points and a number one!!!!!1
Forty Two!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I’ve also uploaded the script to userscripts.org here.

(Thank you for all the code suggestion and corrections!)

30 Comments

  1. Nice script,
    but why not use RegExp the way they’re meant.
    If you use “!+” as a pattern it will replace strings of !’s of any length >0. Even greater than 42. :)

  2. Sam

    I love this script!!!!!!!!!!!!!!!! And it works as well.

  3. Larixk – Thanks for the tip. I’m definitely not a coder.

  4. Rob

    Regarding this line: for (var i = 0; i

  5. Rob

    Ergh, it ate my post. :(

    Regarding this line: for (var i = 0; i %lt; textnodes.snapshotLength; i++)

    I’d be a liar if I said I knew what snapshotLength does. I can’t help but think, though, that assigning textnodes.snapshotLength to a variable before hitting the loop would be faster than having to compute textnodes.snapshotLength every time. Especially on pages with lots of text nodes.

  6. Great script!

    Multiple exclamation points annoy me very much and it’s good to see that somebody came up with a solution for this.

  7. Ron

    Nice–thanks!!!

  8. Divergentdave

    // ==UserScript==
    // @name Eliminate excessive exclamation points
    // @namespace http://www.zieak.com
    // @description Turns exclamation points into just one
    // @include *
    // ==/UserScript==

    (function() {
    var regex, textnodes, node, length;
    textnodes = document.evaluate( “//body//text()”, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    length = textnodes.snapshotLength;
    regex = new RegExp(‘![!1]+’, ‘g’);
    for (var i = 0; i

  9. fearphage

    Are you serious?

    (function(){
    for (var nodes = document.selectNodes(‘//body//text()[contains(.,"!!")]‘), i = 0, node; node = nodes[i]; i++)
    node.data = node.data.replace(/!!+/g, ‘!’);
    })()

    Not sure if Firefox supports selectNodes

  10. Billy

    This blog post was linked on Lifehacker, and there were alot of comments there “challenging” what it couldn’t do. I took a few minutes to add a few patterns to deal with those cases as well.

    Here, enjoy some more regexes (drop these into the script in place of the existing portion)

    This should cover ??????, !?!?!?!?!, and !!!11!!!!!11!!1!1

    http://www.doorknobsoft.com/codetests/exclam_regex.txt

  11. clawbakes

    thanks. my hero.

  12. Thanks Billy – i wanted to include a way to fix those also but making those changes doesn’t seem to work for me.

  13. Wow, great app. I’m going to link you to my blog.
    -Joe

  14. Monoto

    My coding knowledge is virtually nil, or I’d take a stab at this myself, so here’s a suggestion.

    Is there any way to make the replacement exclamation mark colored? Maybe a dark red so it’s noticeable without being blatant?

  15. Good idea – I’ll take a stab at it sometime and if i get it working i’ll email you and let you know.

  16. This one makes sence “One’s first step in wisdom is to kuesstion everything – and one’s last is to come to terms with everything.”

  17. Great! And I would just love to hav the same kind of script for interrogation marks.

  18. Found a nasty little bug in the script – it broke digg comments.
    So I fixed it and uploaded a working version to userscripts.
    Hope you don’t mind. :)

  19. Zieak

    Very nice!

  20. paulnjean

    I live in a town called Palisades Park, New Jersey. A printed sheet of little payment-reminder stickers contains this heading: “Stickers!!!!!!”
    When I asked the tax collector why so many exclamation marks, he replice “So people will notice.” Not wanting to get on the bad side of the tax collector, I kept quiet. But had to ask myself, What if something were really and truly urgent, life and death, how many exclamation marks would that require?

  21. Paul Watson

    In the town I live, Palisades Park, New Jersey in USA, the tax bill encloses little gummed reminder stickers. The heading on the paper proclaims: “Stickers!!!!”

    Am wondering how many exclamation marks would be required for announcement of an impending tornado or earthquake.

Trackbacks

  1. perfect failure dot org » !! = !
  2. Mattie’s Blog » Blog Archive » I’m not the biggest fan of exclamation points.
  3. random assignment » Useful tool for students (and others)
  4. Ivar Zantinge » Blog Archive » Eliminate exclamation points!!!!!
  5. urbanbohemian.com » oh em gee, SNOW!
  6. Inside Joe’s Head » Eliminate extra exclamation points!!! on Zieak’s Blog
  7. The Burncopy » links for 2007-01-20
  8. People who use excessive exclamation points are … - On the Edge - Kristi Gustafson - Style Fashion Dating Blog - timesunion.com - Albany NY
  9. Wishing That Excessive Web Copy Was as Easy to Get Rid Of as Excessive Exclamation Points | Andy Darnell's Thoughts and Ponderings

Leave a Reply