Closed ltegman closed 7 years ago
Sure! Any reason not to simply make it /\{\{([\s\S]+?)\}\}/g
though? I'm not sure I see the reasoning of the non-capturing group ((?:.|\s)
) in yours.
Edit I was using lodash's default as reference: https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L114
Nope, your regex looks like the simpler solution! I'll put in a PR for this tonight or tomorrow :smile:
The current regex for string interpolation boundaries in the
msg
field is/\{\{(.+?)\}\}/g
, which does not allow line breaks inside the interpolated area. This can lead to really difficult to read code if the statement being interpolated is lengthy. Would you be open to a PR changing this regex to something like/\{\{((?:.|\s)+?)\}\}/g
, which would allow linebreaks?