1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Open Forum' started by Budi, Dec 5, 2015.

  1. Budi

    Joined:
    Nov 8, 2015
    Messages:
    16
    Likes Received:
    0
    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 '
     
  2. Budi

    Joined:
    Nov 8, 2015
    Messages:
    16
    Likes Received:
    0
    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
     

Share This Page