. why did you insert that dot star at the end?
it want alter the match in any way, it just captures the
rest of the string in $5.
one problem you might have a look into is the context
of your matching. for example, strings like
"2243423423.23.23.2312blabla34" or "1.2.3.4.5.6.7.8.9"
will match even though they probably don't contain what you
want to match as a valid ip address.