Hmm.
- 411.com - should pass
- penny-arcade.com - should pass
- bad-.com - should fail
- -bad.com - should fail
- 6-7.m-w.com - should pass
- 9999999999999999999999999.z.no - should pass
- 200.100.50.1.uk - should fail
- 1.com should fail
- 1.hostile.com should pass
- 256.com should pass
The original rule was:
[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?
for each label between dots since that way a program that
discriminated between network addresses and host names
could simply sniff the first char. That has since be
"warped" in the root tables to allow the much more complex
well if it doesn't start with a number between 0-255 without
any a-zA-Z- or it has only three labels we'll just assume...
basically, FQDN is just a theory to verify without asking
a DNS server. But you SURELY need '-' hyphens in there.
and should 1.co.uk match or how about 1.com or 256.com?
Sorry 'bout this but domain name vs. hostname madness is
a particular bone in my throat. Just when I think I've
swallowed it, it's choking me again.
--
$you = new YOU;
honk() if $you->love(perl)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.