TIL V8 can keep huge strings alive through legacy RegExp last-match state.
In short, a regex match can keep the entire input string alive -- even after you’re done using it. It stays allocated, adding unnecessary memory pressure, until another successful match replaces that state.
Since everybody loves regex so much, I’ve remade the regex quiz on the site from scratch. New and improved challenges, try it on regex101.com/quiz
I saw this great library submission recently, and just wanted to take the opportunity to give kudos to its author, Tiago Cussiol, and share it with you all.
Super detailed description, and a 560 unit test suite to back it up: regex101.com/library/0BFrkM
Try it on regex101.com or checkout the docs: docs.regex101.com/applicatio…
regex101 retweeted
Replying to @neo_subhamoy
regex101 is keeping the entire software industry running tbh
There are two "ana"s in "banana". 🍌
/ana/g only finds one.
/(?=(ana))/g captures both.
The trick: a lookahead checks ahead without consuming characters, so overlapping captures are possible.
#regex #JavaScript
regex101 retweeted
Replying to @charlotteba22
100%! Regex101 has saved so many developers from endless headache.



