Code example for MatchResult

Methods: groupgroupCount

	private static long findLongByMatchInMemInfo(final String pPattern)
			throws Exception { 
		final Scanner scanner = scannerFile(MEMINFO_PATH);
		final MatchResult matchResult = scanner.match();
		if (scanner.findWithinHorizon(pPattern, 1000) != null
				&& matchResult.groupCount() > 0)
			return Long.parseLong(;
			throw new Exception();
	public static long getFreeMemory() throws Exception { 
		return findLongByMatchInMemInfo(getPatternValueKb("MemFree")); 
Connect your IDE to all the code out there  Get Codota for Java