I am trying to apply a java regex to the following text to extract the content but the problem is that when there is only one href in the text it find the content fine, but when there is more, then it goes to the end of the text. here is the regex pattern:
Pattern pattern = Pattern.compile("\\\"\\>(.*)\\</a\\>\\<br\\>", Pattern.DOTALL);
here is the text :
<div><b>Attachments:</b> <a href="http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/1.JPG">http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/1.JPG</a><br><a href="http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/yinYang.gif">http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/yinYang.gif</a><br><a href=""></a></div>
so if there is only the href for 1.JPG then it find the right answer:
http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/1.JPG
but when I add the yinYang.gif then if find the following :
">http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/1.JPG</a><br><a href="http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/yinYang.gif">http://projectspace.intranet.group/sites/CFY366N/Lists/Deliverables/Attachments/8/yinYang.gif</a><br>
How can I change this to find all the values between <a> ...</a>
in different groups.