Shameless plug: My Regex engine (https://pkg.go.dev/gitea.twomorecents.org/Rockingcool/kleing...) has dedicated syntax for this kind of task.
<0-255>\.<0-255>\.<0-255>\.<0-255>
will only match full IPv4 addresses, but is a lot stricter than the one in the article.EDIT: formatting