needs testing but this may be a better alternative;

```javascript
var matches = url.match(/bbc\.co(\.uk|m)$/);
if (matches.length === 2) {
  return matches[0];
}

return false;
```