Skip to content

Instantly share code, notes, and snippets.

@rwaldron
Created November 22, 2011 17:49
Show Gist options
  • Save rwaldron/1386354 to your computer and use it in GitHub Desktop.
Save rwaldron/1386354 to your computer and use it in GitHub Desktop.
var subject = "[Subject] is dead, long live [Subject]",
regex = /\[Subject\]/g;
while( regex.test(subject) ) {
subject = subject.replace( regex, subject );
console.log( subject );
}
// Warning... I killed node with this.
// FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory
// Crash shot: http://gyazo.com/33c14277400807f210547943d46b5046.png
// Latest revision courtesy of Mike Pennisi
@rwaldron
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment