// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class AttribGet {
    public static void test(String s) {
        System.out.println(s);
        Pattern p = Pattern.compile("<div\\s+id\\s*=\\s*[\"']([^\"']*)[\"']\\s+class\\s*=\\s*[\"']([^\"']*)[\"']\\s+rel\\s*=\\s*[\"']([^\"']*)[\"']>[^<]*</div>", Pattern.CASE_INSENSITIVE);
        System.out.println(p.pattern());
        Matcher m = p.matcher(s);
        if(m.find()) {
            System.out.println(m.group(1) + " " + m.group(2) + " " + m.group(3) + " ");
        }

    }
    public static void main(String[] args) {
        test("<div id=\"Modul\" class=\"Form\" rel=\"1\">Tekst</div>");
    }
}
