hello

please help me to understand the below

#!/bin/bash
read -p "enter your value" ip
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]
then
echo "valid"
else
echo "invalid"
fi

With input 923.234214.23, the result is valid. With 923.3444.2123, it is invalid.

How can I solve this?