I want to skip the url which contains any office file format or pdf at the end of url here is my code.
String Url ="http://chemistry.csudh.edu/faculty/jim/aromaticity.ppt";
if (!Url.matches(".*(doc|dot|docx|docm|dotx|dotm)")
|| !Url.matches(".*ppt|pot|pps")
|| !Url.matches(".*xls|xlt|xlm")
|| !Url.matches(".*pdf"))
System.out.print(Url);
else
System.out.print("true");
I want to know what is wrong with this code fragment as it prints url every time but i want to skip the url which contain any of above format.