This is to judge whether an input exists:
@echo off
setlocal
set /p a=Judge whether the entered character is within the range:
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
echo %b%|findstr /i "%a%" >nul&&echo Your input is correct||echo I'm sorry comrade, the date or week you entered does not exist
endlocal
This is to judge the judgment of continuous input of three, for example: judge whether 1,6,9 is correct
@echo off
setlocal
set b=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,M,T,W,Th,F,S,Su
set /p a=Judge whether the entered character is within the range:
for /f "tokens=1,2,3 delims=," %%a in ("%a%") do (
echo %b%|findstr /i "%%a" >nul&&echo %b%|findstr /i "%%b" >nul&&echo %b%|findstr /i "%%c" >nul&&echo You input correctly||echo You input
wrong
)
endlocal
This is the current situation, the limitation is too big, but see if it can be simplified or increase the judgment ability