Skip to content

Instantly share code, notes, and snippets.

@calvinjuarez
Last active February 29, 2024 14:14
Show Gist options
  • Save calvinjuarez/a5b288b87e693b516fd25eedb125ccc2 to your computer and use it in GitHub Desktop.
Save calvinjuarez/a5b288b87e693b516fd25eedb125ccc2 to your computer and use it in GitHub Desktop.
Quick Regular Expression sketch for matching Mustache-style bits in a string.
var re = /\{\{((?!\}\})(.|\n))*\}\}/g
/**
* Note: This was not tested against any thourough example or any specific spec. Just kind of what I
* felt in my gut. That said, if you feel like commenting with suggestions for improvement, especially
* against any particular spec or whatever, please be my guest.
*
* To see my initial test, visit https://regex101.com/r/GQZ2nW/1/.
*
* Thanks!
* -calvin
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment