Sorry, but there's no solution. Consider the example
\begin{filecontents*}{\jobname-example}
%<*tag>
some text
%some more text
%</tag>
\end{filecontents*}
\documentclass{article}
\usepackage{catchfilebetweentags}
\begin{document}
\tracingmacros=1 % for debugging
\CatchFileBetweenTags{\foo}{\jobname-example.tex}{tag}\show\foo
\CatchFileBetweenTags*{\foo}{\jobname-example.tex}{tag}
%\ExecuteMetaData[\jobname-example.tex]{tag}
\end{document}
The first \CatchFileBetweenTags
starts with
\CatchFileBetweenTags #1#2#3->\CatchFileBetweenDelims \CatchFBT@tok {#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize ]\CatchFBT@Final {#1}
#1<-\foo
#2<-\jobname -example.tex
#3<-tag
whereas the second one has
\CatchFileBetweenTags #1#2#3->\CatchFileBetweenDelims \CatchFBT@tok {#2}{%<*#3>}{%</#3>}[\CatchFBT@sanitize ]\CatchFBT@Final {#1}
#1<-*
#2<-\foo
#3<-\jobname -example.tex
and you can clearly see that something is wrong.
Worse: the definition of \ExecuteMetaData
is
% catchfilebetweentags.sty, line 53:
\newrobustcmd*\ExecuteMetaData[2][\jobname]{%
\CatchFileBetweenTags\CatchFBT@tok{#1}{#2}%
\global\expandafter\CatchFBT@tok\expandafter{%
\expandafter}\the\CatchFBT@tok
}% \ExecuteMetaData
so there is no provision at all for distinguishing between \ExecuteMetaData
and \ExecuteMetaData*
.
Apparently the author documented his wishes about the package, but forgot to implement them.