Yep, you can do this by getting all the UK country IP blocks here.
nirsoft.net/countryip/gb.html, but then what about neighboring countries then?
here is an online IP to CIDR site: ip2cidr.com/
We recently ran extensive testing on IP blocking vs CAPTCHA and CAPTCHA is by far the simpler and much more effective approach. See our test results here: forum.ait-pro.com/forums/topic/buddypress-spam-registration-buddypress-anti-spam-registration/#post-9378
Note: what is not mentioned is that we tried some well known conventional CAPTCHA plugins prior to doing extensive IP testing and we were still getting quite a lot of spammer registrations/spam posts. A Logical explanation would be that the spammers have created a “dictionary” file where they have entered in all the possible CAPTCHA combinations to automate spam registrations/logins/posting.