April 29th, 2010
Here is a JavaScript Regular Expression that will loosely validate any URL string.
/^(http(s)?:\/\/)?([\w-]+\.{1})*(([\w-]*){1}(\.{1}[A-Za-z]{2,4}){1}){1}(\:{1}\d*)?([\?\/|\#]+[\@\~\;\+\'\#\,\.\%\-\/\&\?\=\w\$\s]*)*$/i
Explanation of each portion:
(http(s)?:\/\/)?
url scheme: match only "http" or "https" 0 or 1 times
([\w-]+\.{1})*
subdomains: match any alphanum or hyphen containing strings ending in a dot 0 or n times
(([\w-]*){1}(\.{1}[A-Za-z]{2,4}){1}){1}
top level domain: match exactly one [alphanum or hyphen containing string suffixed by a dot and then a 2-4 char string]
(:{1}\d*)?
port: match the colon and port number 0 or 1 time
[\@\~\;\+\'\#\,\.\%\-\/\&\?\=\w\$\s]*
query strings, anchors, filenames: allow a variety of valid characters for these
December 12th, 2009
I have a new website. Whoo hoo!
After a few weekends of laying out a design, CSS-ing, HTML-ing, and configuring Wordpress I finally have my new website up and ready to roll. Of course it's not "finished" because we all know that a website is never finished, but at least it's presentable. So bear with me as I iron out the kinks, as this is very much work-in-progress.
Anyway I created this site because my old site was a bit too specific to only one of my interests. Here I'll be writing about and linking to various topics. Anything ranging from Life in Japan to Electronics to Music Production to Photography. However, may all non-nerds be forewarned — since I am a computer scientist, spend too much time on this Internetweb thing, and am a pro Web Developer — I will be posting much about Web Development techie related things. Wether you're into techie stuff or not, hopefully you'll find something of interest here. Please feel free to comment and send me feedback.
Oh, and also… don't forget to checkout the nifty Lifestream area of the site where you can follow all of what I'm up to recently via my interactions on The Internet.
Tags: edrooth.com, Wordpress