A: Yes. But it is not as powerful as it should be.
But first, let's answer a question that you didn't ask (yet) because it is a natural follow-up question.
Q: Will the question mark match any single character in the batch string search and replace with SET?
A: No. It is a regular character, and will only match it'self.
The asterisk IS a wildcard and WILL match multiple characters, but will ONLY match everything from the very beginning of the string. Not in the middle, and not from the end.
Useful Searches:
*x
*how are you?
The above two searches CAN be matched. The first will match everything up to and including the first "x
" it runs across. The second one will match everything up to and including the first "how are you?" it finds.
Legal, but Unuseful, searches:
x*
Hello*
One*Three
The above three searches can NEVER be matched. Oddly they are also legal, and will cause no errors.
One exception: Hello* and x* WILL match themselves, but only if they are the very beginning of the string. (Thanks Jeb!)
Two examples you can type or paste in at a command prompt:
REM A successful search and replace.
SET X=Hello my friend. How are you?
SET X=%X:*.=%
ECHO Output: "%X%"
Output: " How are you?"
REM Unexpected action causing an unsuccessful search and replace.
SET X=Hello my friend. How are you?
SET X=%X:.*=%
ECHO Output: "%X%"
Output: "Hello my friend. How are you?"
Logiclly, .* should match everthing from the period on, resulting in the string
being truncated to "Hello my friend". But since the * only matches from the start
of the string, the .* matches nothing, and so the string was left unchanged.