hello I am making web page searching program with windows batch file
before searching it, I need to save html code to variable and regex.
I am on windows xp sp3
I wonder how can I send special character mixed string as function parameter
my code is here
cd curl-7.25
for /f "tokens=*" %%R IN ('curl.exe -G --max-redirs 3 http://www.google.com?') DO call:MyFunc %%R
pause
:MyFunc
echo %~1
goto:eof
the problem is on “call:MyFunc %%R”
the html code includes many ‘<‘ and ‘>’ (brackets)
and this interpreted as piping.
which I am trying to avoid.
any help would be appreciated
You can’t escape the content of %%R, as you receive it from curl.
But you can handle it with delayed expansion.
I first disable delayed expansion, else you get problems with exclamation marks and/or carets.
And then I call
:MyFuncwith the variable name not the content, as call would modify the content.And to access the content I enable the delayed expansion, as delayed expansion never modify or interfere with the content of a variable.