Revision 676

tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java (revision 676)
38 38
	public static ArrayList<String> findWithGroup(File file, String encoding, String pattern, boolean normalizeSeparators) throws IOException {
39 39
		ArrayList<String> matches = new ArrayList<String>();
40 40
		String text = IOUtils.getText(file, encoding);
41
		if (normalizeSeparators) text = text.replaceAll("\\s", " ");
42
		if (normalizeSeparators) text = text.replaceAll("\\t", " ");
43
		if (normalizeSeparators) text = text.replaceAll("\\n", " ");
44
		if (normalizeSeparators) text = text.replaceAll("[ ]+", " ");
41
		if (normalizeSeparators) {
42
			text = text.replaceAll("\\s", " ");
43
			text = text.replaceAll("\\t", " ");
44
			text = text.replaceAll("\\n", " ");
45
			text = text.replaceAll("[ ]+", " ");
46
		}
45 47
		
46 48
		Pattern test = Pattern.compile(pattern);
47 49
		Matcher m = test.matcher(text);

Also available in: Unified diff