handle hash target in url for pattern