Hi i would like to find that code in HTML
{%foreach damagePhotos : photo%}
<img src="{%=photo}" alt="" width="320" height="200"/>
{%endforeach%}
My regexp is:
Matcher matcher = Pattern.compile("\\{\\%foreach\\s(.*)\\s:\\s(.*)\\%\\}\\s(.*)\\s\\{\\%endforeach\\%\\}",Pattern.MULTILINE).matcher(parsedHtml);
And everything work fine untile i've got many of that pattern i html :(
for example:
<p>
{%foreach carPhotos : photo%}
<img src="{%=photo}" alt="" width="320" height="200"/>
{%endforeach%}
</p>
<p>
{%foreach damagePhotos : photo%}
<img src="{%=photo}" alt="" width="320" height="200"/>
{%endforeach%}
</p>
Then mather find one match and group(1) is:
carPhotos : photo%} <img src="{%=photo}" alt="" width="320" height="200"/> {%endforeach%}</p><p> {%foreach damagePhotos
What is wrong with my regexp ?