See also: raku's grammars (https://docs.raku.org/language/regexes).
raku: ^ ( \d+ <?{ $/ <= 255 }> ) ** 4 % '.' $
slow raku: ^ ( @(0..255) ) ** 4 % '.' $
rulex: <% ( :( range '0'-'255' ) '.' ){3} :( range '0'-'255' ) %>
regex: ^(?:(0|1[0-9]{0,2}|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?|[3-9][0-9]?)\.)((0|1[0-9]{0,2}|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?|[3-9][0-9]?))$
first one running code in the middle of the regex, to see if it matches a mathematical property, the second, running code to generate a [0|1|2|3|...|254|255] equivalent, which also matches as tightly as the rulex/regex code (e.g. no 00 allowed) /^ (\d+) ** 4 % \. <?{ $/[0].all <= 255 }> $/
or if wanting it really explicit /^ (\d+) \. (\d+) \. (\d+) \. (\d+) <?{ $/.all <= 255 }> $/As other's have said, it is a minor arguably cosmetic improvement and something that is likely easier just to use a visual helper like regex101 to help you construct.