gulp-include-source icon indicating copy to clipboard operation
gulp-include-source copied to clipboard

Full regex support

Open ritenv opened this issue 9 years ago • 1 comments

Support for full RegEx patterns would be extremely helpful, and expected (works for the grunt counterpart)

<!-- include:js(system/**/!(*.module).js) -->

ritenv avatar May 12 '16 20:05 ritenv

Below is what works:

function matchExpressions(contents) {
  return contents.match(/<!--\s+include:([a-z]+)\(([^\s]+)\)\s+-->/);
}

Basically, I replaced ^) with ^\s to rely on the last space character. Not the prettiest solution, probably.

ritenv avatar May 12 '16 21:05 ritenv