Is it a bug in for command..? please consider it..

Nov 8, 2015
24
1
#1
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 '
 
Nov 8, 2015
24
1
#2
I'm so sorry to everyone but I am about to answer my own question as I just found it accidentally. If one is going to use alternation in regex reside in a body/block of codes then he must preceed it with SETDOS /X-5 as it prevents command meaning of character | (pipe) which is used synonymly for alternation in every regex engine. He may then follow his regex line/code with SETDOS /X0 to restore the original setting
 
Likes: ron