Here's some test code I'm working with: ## begin ##
while ($name = <DATA>) { $name =~ /(\w*)\.*/; $name{$1}++; $name =~ /(\w+)/; print "$& \n"; } __DATA__ tibor.test.net mars.test.net moon-bx-r.test.net moon-bs-d.test.net moon-bt-321.test.net ## end ## This works for hostnames without hyphens, but when there is a hyphen in the name, everything after the hyphen is ignored. I've been trying things like $name =~ /[a-z]*\-*\-*/ with no luck. The data coming into the expression may or may not be fully qualified, so I can't just take everything to the left of .test.net, and the domain name may be different at times, anyway. So what I'm left with finding an expression that will match any alphanumeric, with 0 or more embedded dashes. It sounds simple, but I can't seem to find it. What am I missing? Thanks, d -- Please respond to the list... NOT to me directly. o _ _ _ _o /\_ _ \\o (_)\__/o (_) _< \_ _>(_) (_)/<_ \_| \ _|/' \/ (_)>(_) (_) (_) (_) (_)' _\o_ http://zapatopi.net/afdb.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]