I know referer can be faked or disabled but this isn't anything more than a fun feature on my one page actually so it's not needed. Anyway I think the issue is with the [www.]? part or it may be with the colon, not sure.
There were 2 issues:
1) You had an extra colon in there.
2) Brackets are used to list allowed characters, not to denote a section (that's not the right word, but hopefully you get what I mean). Use parenthesis to denote a section. Adding ?: after the first parenthesis means that it doesn't capture the match -- it's optional for your usage here.