Fixed (I think) the regex (if it was actually broken) and also made a change to URI validity check.