@Test
    public void testDetectRegExGreedy() throws Exception {
        String pattern = "(?s)\\x3chtml xmlns=\"http://www\\.w3\\.org/1999/xhtml" +
                "\".*\\x3ctitle\\x3e.*\\x3c/title\\x3e";
        MediaType xhtml = new MediaType("application", "xhtml+xml");
        Detector detector =
                new MagicDetector(xhtml, pattern.getBytes(US_ASCII), null, true, 0, 8192);

        assertDetect(detector, xhtml, "<html xmlns=\"http://www.w3.org/1999/xhtml\">" +
                "<head><title>XHTML test document</title></head>");
    }
Test cases for the {@link MagicDetector} class.
tika-core/src/test/java/org/apache/tika/detect/MagicDetectorTest.java