Creation of Automatic Group using the last 252,253,254 of the IP address from all Subnets

Is it possible to create a Automatic group using the last IP address of .252, .253, .254 for all subnets? Are wildcards supported or ?

I’m not great with doing multiples of the same thing, so I’m sure there’s a more elegant way of doing it, but

exists addresses whose (it as string ends with (“252”) OR it as string ends with (“253”) OR it as string ends with (“254”)) of ip interfaces whose (not loopback of it) of network as string

Dave can you show the IP address result as well?