// 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.Pattern;

public class RegexAndLines {
    public static void main(String[] args) {
        Pattern p = Pattern.compile("a[x\r\n]*b");
        System.out.println(p.pattern());
        String s = "a\r\nxxx\r\nb";
        System.out.println(s);
        System.out.println(p.matcher(s).matches());
    }
}
