are you trying to validate a URL or just a hostname?
a URL has a LOT of valid non word characters (at least in certain positions...
[_-/:@?#+~.] any other?)
if your are trying to match just the hostname then this would do (tell me if i forgot something)
unless($URLcheck =~ /[A-Za-z\-\.0-9]+/) {
#reject this..
}
Update! i've found
this on slashdot,
i see a short life for my regexp :-)