The above regex will break for the following example http://www.pierobon.org/iis/review1.htm.html#one I got this example from [here.][1] [1]: http://www.pierobon.org/iis/url.htm