In addition to the semicolon issue already mentioned, I think it is worth pointing out that the regexp covers a slightly larger range of possibilities than specifically intended. "." in a regexp means any character, so the "." between index and html needs to be escaped with a "\" to avoid, e.g. indexXhtml.* being included . Probably not important this time, but it might be another time.