Some domain name do have the hyphen in and the expression you were using was to try and match all of them.
If you are sure there will never be a hyphen in the name you are trying to match then you can miss it out.
which will match www.contoso.com but it wont match a website called www.j-walk.com. Your original pattern would.
I see what you are trying to do with your pattern. Maybe it might help you to start of with a simple pattern that will match your example. Then see how you would change it to deal with other host names.
Try
www.[a-z]{1,}.[a-z]{2,3}