Is it possible to write such instruction by writing only once BCC Fans community
?
if (document.title.match(/(.+?) - BCC Fans community$/)) {
document.title = document.title.match(/(.+?) - BCC Fans community$/)[1]
} else if (document.title.match(/^BCC Fans community - (.+)/)) {
document.title = document.title.match(^/BCC Fans community - (.+)/)[1]
}
Write them as string and then use new RegExp(_STRING_);
see this