alternation (|) in regex works perfectly in its own, but when it's inside 'for' block it doesn't. Why so? For example : echo %@regexsub[0,d:\\(c|d|e|f)\.+,d:\data] will report/echo 'd:\data'. What for /f "delims=" %a in ('dir /b d:\') echo %@regexsub[0,d:\\(c|d|e|f)\.+,"%a"] will give ' echo off '