Last active
February 29, 2024 14:14
-
-
Save calvinjuarez/a5b288b87e693b516fd25eedb125ccc2 to your computer and use it in GitHub Desktop.
Quick Regular Expression sketch for matching Mustache-style bits in a string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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