Closed cengage closed 12 years ago
All the headache with hostname format seems unnecessary. It seems reasonable to match using something much simpler, like /^[a-zA-Z0-9.-]+$/. Alphanumberic characters, periods, and hyphens. I can't think of a situation in which this constraint will lead to a problem.
You're right, the simplest regex possible seems to work OK. There was a lot of pattern capturing going on that I couldn't quite tell if it was being used further down the line or not. Since it sounds like it wasn't I say go with the simplest form and everyone will be happy. I have updated the regex on my server and it's working fine. I can send the pull request for it or you guys can just roll it into a next commit.
Strangely enough this works when importing records but now when editing an existing record it will not save when using hyphenated hostnames. I'm troubleshooting this so I would not commit this yet.
Thanks, Pepijn.