findstr 没有找到 "homepage":"http://www.google.com/"
findstr does not find "homepage":"http://www.google.com/"
@echo off
cd /D "C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\"
set ffile=%cd%
findstr /m ^"homepage^":^"http://www.google.com/^" "%ffile%\Secure Preferences"
if %errorlevel%==0 (
echo Ok
)else (
echo "Not Ok"
)
pause
当我搜索 "homepage":"http://www.google.com/"
时,findstr
不会 return 任何东西,但当我只搜索 "homepage" 时它会起作用 - 为什么?
findstr
有 "it's own" 字符转义规则(嗯,这是 REGEX 规则)(参见 findstr /?
):
findstr /r /c:\"homepage\":\"http://www\.google\.com/\" "%ffile%\Secure Preferences"
(点也必须转义,因为它是 "any char" 的 REGEX 代码)
@echo off
cd /D "C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\"
set ffile=%cd%
findstr /m ^"homepage^":^"http://www.google.com/^" "%ffile%\Secure Preferences"
if %errorlevel%==0 (
echo Ok
)else (
echo "Not Ok"
)
pause
当我搜索 "homepage":"http://www.google.com/"
时,findstr
不会 return 任何东西,但当我只搜索 "homepage" 时它会起作用 - 为什么?
findstr
有 "it's own" 字符转义规则(嗯,这是 REGEX 规则)(参见 findstr /?
):
findstr /r /c:\"homepage\":\"http://www\.google\.com/\" "%ffile%\Secure Preferences"
(点也必须转义,因为它是 "any char" 的 REGEX 代码)