A: Yes. But this is not as strong as it should be.
But first, let me answer a question that you did not ask (yet), because this is a natural follow-up question.
Q: Will the question mark match any single character in the search for a batch string and replace SET?
A: No. This is an ordinary character and will correspond only to him.
The asterisk IS is a wildcard and will match multiple characters, but will ONLY match all from the very beginning of the line . Not in the middle, not at the end.
Useful searches:
*x *how are you?
The above two queries can be matched. The first will correspond to all, up to the first "x" with which he encounters. The second will correspond to all, up to the first "how are you?" He finds.
Legal, but not used, search:
x* Hello* One*Three
The above three search queries can NEVER be matched. Oddly enough, they are also legal and do not cause errors.
One exception: Hello * and x * WILL match themselves, but only if they are the very beginning of the line. (Thanks to Jeb!)
Two examples that you can enter or paste on the command line:
REM Successful search and replacement.
SET X = Hello my friend. How are you? SET X =% X: *. =%
ECHO Output: "% X%"
Conclusion: "How are you?"
REM An unexpected action that caused an unsuccessful search and replace.
SET X = Hello my friend. How are you? SET X =% X :. * =%
ECHO Output: "% X%"
Result: "Hello my friend. How are you?"
Logically,. * must match the time period, as a result of which the line is truncated to "Hello my friend." But since * only matches from the very beginning of the line ,. * nothing matches, and therefore the line remains unchanged.