var delims = require('{%= name %}');
Example:
Get a regex for matching front-matter:
delims('---', '---');
//=> /---\s*([\s\S]*?)\s*---/
If no args are passed, es6 delimiter regex is returned:
delims();
//=> /\$\{\s*([\s\S]*?)\s*\}/
- delimiters
{String|Array}
: supports array format (delims(['{{', '}}'])
) or list (delims('{{', '}}')
) - options: currently RegExp
flags
is the only option
Flags example
delims('{{', '}}', {flags: 'gm'});
//=> /\{\{([^}}]*)\}\}/gm