in reply to Regex for hostname validation
Seconding the other reply this feels like (almost) an X/Y problem. At first skim over title and first sentence my off the cuff instinct was "Just try and resolve the name to an IP with Net::DNS, or gethostbyname and let your libc handle things" and be done with it. I could see several cases where some of your constraints while "RFC legal" wouldn't apply still (e.g. I've used a custom non-standard internal TLD for local names that's valid in the context I used it; (internal) DNS certainly would have resolved it but it would have failed bullet 2).
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex for hostname validation
by hrcerq (Monk) on May 03, 2025 at 01:05 UTC |