from Hacker News

JavaScript regular expressions

by btipling on 8/18/14, 12:26 AM with 4 comments

  • by chdir on 8/18/14, 3:38 AM

  • by chrismorgan on 8/18/14, 2:18 AM

    The statefulness of the combination of the g flag and .exec() cost me several hours a couple of months ago on a necessary upgrade, finding something deep inside a router that had been fine with /g before but which had after changes made the implicit assumption that .exec() was idempotent. Having it work every second time was a little annoying.