in reply to Test the syntactic validity of a domain name

fixed, updated, whatever...

Randal, could it be sped up via a "must match this" regex?
sub valid_domain { return $_[0] =~ m{ \A (?: (?!\d+\.) [a-zA-Z0-9]+ (?: -+ [a-zA-Z0-9]+ )* \. )* (?!\d+\z) [a-zA-Z0-9]+ (?: -+ [a-zA-Z0-9]+ )* }x;


$_="goto+F.print+chop;\n=yhpaj";F1:eval

Replies are listed 'Best First'.
RE: RE: Test the syntactic validity of a domain name
by tye (Sage) on Sep 20, 2000 at 21:07 UTC

    Seemed close but allowed "-" as last char of components.

            - tye (but my friends call me "Tye")
      I fixed it. I guess I should've done update or something like that, as I've seen in other people's posts.

      $_="goto+F.print+chop;\n=yhpaj";F1:eval