public boolean shouldVisit(WebURL url) { Pattern filters = Pattern.compile(".*(.(htm|html))$"); String href = url.getURL().toLowerCase(); if(filters.matcher(href).matches()){ return true; } return false; }
public int getNoOfQuestions(){ Pattern p = Pattern.compile("Ans."); Matcher m = p.matcher(text); int count = 0; while (m.find()){ count = count + 1; } return count-3; }