That's one of the beauties from PowerShell, you have access to all the .Net classes.
The IPAddress class has some methods.
Beats constructing RegEx expressions to achieve the same :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference