@Test public void testByAttributeRegex() { Document doc = Jsoup.parse("<p><img src=foo.png id=1><img src=bar.jpg id=2><img src=qux.JPEG id=3><img src=old.gif><img></p>"); Elements imgs = doc.select("img[src~=(?i)\\.(png|jpe?g)]"); assertEquals(3, imgs.size()); assertEquals("1", imgs.get(0).id()); assertEquals("2", imgs.get(1).id()); assertEquals("3", imgs.get(2).id()); }
public static Elements select(String query, Element root) { return new Selector(query, root).select(); }
Selector { public static Elements select(String query, Element root) { return new Selector(query, root).select(); } }
Selector { public static Elements select(String query, Element root) { return new Selector(query, root).select(); } private  Selector(String query, Element root); private  Selector(Evaluator evaluator, Element root); }
Selector { public static Elements select(String query, Element root) { return new Selector(query, root).select(); } private  Selector(String query, Element root); private  Selector(Evaluator evaluator, Element root); static Elements select(String query, Element root); static Elements select(Evaluator evaluator, Element root); static Elements select(String query, Iterable<Element> roots); }
Selector { public static Elements select(String query, Element root) { return new Selector(query, root).select(); } private  Selector(String query, Element root); private  Selector(Evaluator evaluator, Element root); static Elements select(String query, Element root); static Elements select(Evaluator evaluator, Element root); static Elements select(String query, Iterable<Element> roots);  }