Reject bucket names that are IP addresses

I don't get your point. new RegExp(str) will simply create a regexp, you don't have to declare a string here.

By the way, for ip-address checking, I think string operations are much simpler -- split by period, check if the number of elements is 4, each component is numeric, ParseInt returns value between 0 to 255.  More descriptive than regexp.