in reply to Matching RFC1912 compliant hostnames
Here's something quick, until someone comes with a better one:
(This doesn't accept 1-letter names, which is probably okay)perl -ne 'print "YES\n" if /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/ && /[a-z]/ +&& ! /\.\./'
update: the original one accepted a..b, now it doesn't (and is less elegant :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Matching RFC1912 compliant hostnames
by Fastolfe (Vicar) on Nov 18, 2000 at 05:43 UTC | |
by fundflow (Chaplain) on Nov 18, 2000 at 06:24 UTC |