Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Regular expression for handlebars variables, includes, if/else blocks and unescaped variables

Regex

{{[{]?(.*?)[}]?}}

Captures the value of the variable name in a handlebars template

{{> components/templates/email/includes/email-tr-spacer }}
{{# deliveryAddress }}
{{^ deliveryAddress }}
{{{ deliveryAddressReadable }}}
{{/ deliveryAddress }}
{{/ contactNumber }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment