Url pattern matching

@rcrichton please test review 
Think this can be removed :)