public static int readFile(String file) {
		int count=0;
		String pattern="[a-z]+=\\d+";
		try {
			BufferedReader br=new BufferedReader(new FileReader(file));
			String line;
			while ((line=br.readLine())!=null) {
				Matcher mt=Pattern.compile(pattern).matcher(line);
				if (!mt.find()) continue;
				String[] items=mt.group().split("=");
				if (items.length>0&&items[0].equals("foo")) ++count;
			}
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return count;
	}