If you know what you are using as your regex at compile time, and not constructing it on the fly then you should use a regex literal:
var regex = /^(?:[a-zA-Z0-9]+(?:\-*[a-zA-Z0-9])*\.)+[a-zA-Z]{2,6}$/
Literals are compiled at the loading of the script, whereas RegExp is changeable at runtime so is slightly slower in performance.
As to why it isn't working correctly, it is probably down to not properly escaping your string. When using regex as a string in RegExp, you have to escape any backslashes, so changin the expression to ^(?:[a-zA-Z0-9]+(?:\\-*[a-zA-Z0-9])*\\.)+[a-zA-Z]{2,6}$
should work.