TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JavaScript regular expressions

47 pointsby btiplingalmost 11 years ago

2 comments

chdiralmost 11 years ago
The short version:<p><a href="http://stackoverflow.com/questions/1520800/why-regexp-with-global-flag-in-javascript-give-wrong-results" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1520800&#x2F;why-regexp-with-g...</a>
chrismorganalmost 11 years ago
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 &#x2F;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.
评论 #8191264 未加载