I have a regex and want it to match html meta tags content attribute and get its content. For example:
<meta name="description" content="Some website description.">
In this case to get
Some website description.
and nothing more. In my case I am using this pattern:
private static Pattern siteMetaTagDescriptionAttributePattern = Pattern.compile("name=\"description\"(\\s*)content=\"(.*)\"");
Matcher matcher = siteMetaTagDescriptionAttributePattern.matcher(siteContentLine);
String siteDescription = "";
while(matcher.find()) {
siteDescription = matcher.group(2);
}
And getting Till the end of the line, in this case this:
Some website description.">
What should I do to get only inner content of the content attribute, in this case
Some website description.
Thanks a lot.