A regex. Specifically /^[[:alpha:][:digit:][:punct:]]+$/
Of course that answers your question, but it's not a good way to validate a URL. URL's are not just made up of arbitrary alphanum and punctuation characters.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"