Your selector means h-Tag with attribute "0-6" here is not a regular expression. But instead, you can combine several selectors: hh = doc.select("h0, h1, h2, h3, h4, h5, h6"); .
Grouping: Do you need a group with all h-tags + a group for each h1, h2, ... tag, or only for each h1, h2, ... tag?
Here is an example of how you can do this:
// Group of all h-Tags Elements hTags = doc.select("h1, h2, h3, h4, h5, h6"); // Group of all h1-Tags Elements h1Tags = hTags.select("h1"); // Group of all h2-Tags Elements h2Tags = hTags.select("h2"); // ... etc.
If you need a group for each h1, h2, ... tag, you can remove the first selector and replace hTags with doc in the rest.
ollo
source share