I think you should consider more conditions , like
name = "this" id = "something" value = 'xxx'
Then your pattern wouldn't meet the requirements such as space between "name" and "=" 'xxx' and string between attribute "name" and attribute "value", so I think the pattern should be like the following form:
private final String matchString = "name\\s*=\\s*(?:\"this\")|(?:'this')" +
".*?" +
"value\\s*=\\s*" +
"(?:\"([^\"]*)\") |(?: '([^']*)')";
private final Pattern pattern = Pattern.compile(matchString,Pattern.DOTALL|Pattern.COMMENTS);
Matcher matcher = pattern.matcher(content);
while(matcher.find())
{
System.out.println(matcher.group(1));
}
At the same time , the tip from up floor is needed!