11 ms·
More like [a-zA-Z][0-9a-zA-Z-]*[0-9a-zA-Z]
by raverbashing 2y ago
More like [a-zA-Z][0-9a-zA-Z-]*[0-9a-zA-Z]
- valenterry 2y agoI'd rather see underscore as standard than hyphen. Underscore to me is a space that is not a space because a space might be a problem or misleading. Hyphens on the other hand are more complicated and have various different meanings. Just my 2 cents.
- amelius 2y agoYes, and also word-completion in various editors (e.g. Vim) does not work with hyphens.
- larsnystrom 2y agoThis is the correct answer, according to standards. See https://en.wikipedia.org/wiki/Hostname https://en.wikipedia.org/wiki/Hostname