package de.wak_sh.client;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Utils {
	public static String match(String pattern, String subject) {
		Matcher matcher = Pattern.compile(pattern).matcher(subject);
		matcher.find();
		return matcher.group(1);
	}

	public static List<String[]> matchAll(String pattern, String subject) {
		List<String[]> matches = new ArrayList<String[]>();
		Matcher matcher = Pattern.compile(pattern).matcher(subject);
		while (matcher.find()) {
			int count = matcher.groupCount();
			String[] match = new String[count];
			for (int i = 0; i < count; i++) {
				match[i] = matcher.group(i + 1);
			}
			matches.add(match);
		}
		return matches;
	}
}

@@ -254,32 +254,48 @@
 .compile(pattern
+, Pattern.DOTALL
 ).matcher(subjec
@@ -280,32 +280,37 @@
 DOTALL).matcher(
+%0A%09%09%09%09
 subject);%0A%09%09matc
@@ -522,16 +522,32 @@
 (pattern
+, Pattern.DOTALL
 ).matche
@@ -548,16 +548,21 @@
 matcher(
+%0A%09%09%09%09
 subject)

Fix regex utils for long messages