Thanks for your thoughtful reply.
... but look carefully at Data-Validate-Domain.t
I will. I'm not against using external modules, it's just that I like to keep things minimal, so unless I'd reimplement the entire module and it's not trivial, I'd rather "reinvent the wheel", as core Perl is already a very nice toolbox and we can accomplish a lot with it.
And yes, looking at the module tests will help a lot, thank you for the suggestion.
... hostnames to browse or hostnames for a DNS entry? Infact you mention internatiolised hostname ...
I mistakenly mentioned IDNs just to make a point on RFCs relationships and the complexities involved, but I don't really have to cope with Unicode here, because I'm dealing with hosts file entries, so even if they used IDNs, they'd be already puny'encoded.
Yet your suggestion was valuable, because if I wanted to validate names before they're encoded, I might do something like that. Also reminded me that I might (and should) use /a option here.
I just wonder which approach would have lesser impact on performance, considering I might have to validate many names at once. Guess I'll have to test it.
return on_success() or die;
In reply to Re^2: Regex for hostname validation
by hrcerq
in thread Regex for hostname validation
by hrcerq
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |