I'm interested in using RegExp for Batch. I put this script together:

@if (@X)==(@Y) @end /* 
@goto :Batch

setlocal disableDelayedExpansion

set "infile="
set "test=%~1"
if defined test (
  setlocal enableDelayedExpansion
  if "!test:~0,1!" neq "/" (
    set ^"infile=^<"%~1""
    shift /1
  ) else endlocal

%infile% %outfile% cscript //E:JScript //nologo "%~f0" "%/d%" 

exit /b 0

var array=new Array(),
delim  =WScript.Arguments.Item.replace(/(a)/gmi,'b'),

The above consists of batch script that makes it applicable to stdin a local text file data in cmd and runs a RegExp related JS replace function and argument with a respective stdout. I tested it with a regular -o switch, but did not see results. What should I do?

New contributor
mojo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

mojo is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.