Your regular expression wont wort for many reasons (see the comments).
The dots indicate that any character can be used you want \.
Try this regular expression:
(?:(?:[01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])
As a reference check this site, there are similar examples:
Regular Experession Examples
P.S.: There are several testing sites on the web for regular expressions, you should use them, for example: Regex101
Edit: The conditional options in the last group must be inverted, if not the match of 2** will get with the two first characters throught first condition, ex: 255.255.255.250 will be matched as 255.255.255.25 (the last digit is lost). Also using non capturing groups in regular expressions is recomended in cases where individual groups (used for alternatives or counting) have no meaning or are not needed.