How to read and validate a IP address (12.001.14) in regex

Dear Members,
We generated a set of IP (15) addresses, which are dependent on each other. In the follow-up, the IP address has to be validated by the previous address. IN this, how to read and validate an IP address (12.001.14) in the regex and default.