Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    S

    Steven Levithan

    blog.stevenlevithan.com · Personal blog · on HN since 2008

    Steven Levithan writes about JavaScript and regular expressions, including trim performance, the RegExp API, and parsing tricks.

    Visit blogRSSHN submissions
    ProgrammingWeb DevelopmentLanguages & Compilers
    What HN says

    HN links it as a regex resource, especially his parseUri script, JavaScript trim benchmarks, and a phone number validation post.

    Stats for nerds
    18HN people shared it
    12linked in comments
    60story points
    Aug 2024last shared
    2010people per year2024

    Top posts on HN

    1. 1
      Regex Legends: The People Behind the Magic
      1 person · 35 points · first shared 2021 · 9 comments on HN
    2. 2
      JS faster replacement for elem.innerHTML
      1 person · 4 points · first shared 2012 · Discussion on HN
    3. 3
      Levels of JavaScript Regex Knowledge
      1 person · 4 points · first shared 2010 · Discussion on HN
    4. 4
      Javascript Trim Showdown
      2 people · 3 points · first shared 2008 · Discussion on HN
    5. 5
      Solving Linear Equation with Regexes
      1 person · 3 points · first shared 2008 · Discussion on HN
    6. 6
      Creating BNF-style grammatical regular expressions in JavaScript
      1 person · 3 points · first shared 2012 · Discussion on HN
    7. 7
      What the JavaScript RegExp API Got Wrong, & How to Fix It
      2 people · 2 points · first shared 2010 · Discussion on HN
    8. 8
      Regex Syntax Highlighter
      1 person · 2 points · first shared 2010 · Discussion on HN
    9. 9
      10 Reasons to Learn and Use Regular Expressions
      1 person · 2 points · first shared 2008 · Discussion on HN
    10. 10
      Matching quoted strings with regexes
      1 person · 1 points · first shared 2012 · Discussion on HN

    What HN people wrote when they linked it

    • laughinghanJan 2011

      Of course it's not the only way, have you seen Google's homepage?

      Also, JScript is actually surprising good and is nothing like the DOM or CSS, AFAIK the only known bugs are Named Function Expressions being parsed as Function Declarations (http://kangax.github.com/nfe/#jscript-bugs), and a couple RegExp bugs (http://blog.stevenlevithan.com/category/cross-browser).

      I suppose if you count DOM bugs, like the memory leak, that's a problem. That's where jQuery is amazingly helpful(and presumably other libraries like it).

      Considering Raphael is as slow as excanvas in IE (but much faster in other browsers), it's probably IE's fault, not excanvases.

    • BinaryBulletOct 2012

      As others have suggested, jQuery is overkill for this.

      The best lightweight js library I've found/used in the past is parseUri:

      http://blog.stevenlevithan.com/archives/parseuri

      Obviously, if you only need to analyze the current URL, you can use window/document.location, but there are times when you want to parse a URI for a page you aren't on. For instance, if you are analyzing har data, and want to break URI "components" into columns so they are sortable.

    • niyazpkOct 2010

      Kudos!

      Looks like the performance improvements are aided by the new native methods in the latest browsers. I wonder at what point they will stop supporting older browsers like IE6.

      Here is the article on different JavaScript trim methods: http://blog.stevenlevithan.com/archives/faster-trim-javascript

    • skennedyFeb 2010

      Someone who offers three solutions to mimic lookbehind's in Javascript:

      http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript/comment-page-1

      Also, there seems to also be a lot of support for leveraging PHP's regex functionality on the server-side to accomplish this.

    • DanBCMar 2012

      (http://blog.stevenlevithan.com/archives/validate-phone-number)

      (http://en.wikipedia.org/wiki/E.164)

      (http://en.wikipedia.org/wiki/Telephone_number)

      (http://en.wikipedia.org/wiki/Telephone_numbering_plan)

    • mhotchenAug 2024

      https://www.regular-expressions.info/

      and

      https://blog.stevenlevithan.com/

    Related

    Ben Almanbenalman.com35 people

    JQuery BBQ: Back Button & Query Library

    Ben Alman
    Personal · last shared 2025
    Shtetl-Optimizedscottaaronson.com1k people

    First they came for the Iranians

    Shtetl-Optimized
    Personal · last shared 2026
    James Sinclairjrsinclair.com48 people

    What’s so great about functional programming anyway?

    James Sinclair
    Personal · last shared 2026
    Lambda the Ultimatelambda-the-ultimate.org615 people

    Simon Peyton Jones Elected into the Royal Society Fellowship

    Lambda the Ultimate
    Publication · last shared 2026
    Alexis Kinglexi-lambda.github.io172 people

    Parse, Don’t Validate

    Alexis King
    Personal · last shared 2026
    Steve Loshstevelosh.com219 people

    Git koans

    Steve Losh
    Personal · last shared 2026
    Steve Soudersstevesouders.com157 people

    Cache Them If You Can

    Steve Souders
    Personal · last shared 2026
    Pony Fooponyfoo.com54 people

    The Controversial State of JavaScript Tooling

    Pony Foo
    Personal · last shared 2022