regex to match ipv4 address with grep code example Example: grep ip address grep -oE "\b([0-9]{1,3}\.){3}([0-9]{1,3})\b" $file