grep for ip address code example
Example 1: grep ip address
grep -oE "\b([0-9]{1,3}\.){3}([0-9]{1,3})\b" $file
Example 2: ip address regex validate cmd
echo off
:start
cls
set /p localWireless=input wireless ip address ? &
echo %localWireless% | findstr /i /r [0-9].*.[.].*.[0-9].*.[.].*.[0-9]
if %errorlevel% equ 0 (
goto installLocalWireless
) else (
msg %username% 'ip address is not valid'
goto start
)
:installLocalWireless
cls
echo Hello Wordl
pause
goto start