You could perhaps use optional groups (?: ... )?
instead and use another grouping for the first 3 parts of the IP?
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}
(?:25[0-5](?:-25[0-5])?|
2[0-4][0-9](?:-(?:25[0-5]|2[0-4][0-9]))?|
[01]?[0-9][0-9]?(?:-(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?|
\*)$
Updated with capture groups
^((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.
((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.
((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.
(25[0-5](?:-25[0-5])?|
2[0-4][0-9](?:-(?:25[0-5]|2[0-4][0-9]))?|
[01]?[0-9][0-9]?(?:-(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?|
\*)$