I'm looking for a regular expression, but can't find.
Parsing a text file looking like that
<resource name="/_op_sox/Project/Default/ICDocumentation/Evaluation/Allianz/Allianz SE/Eval_01241.txt"
inheritAcls="true">
<bundle name="AZEvaluation">
<property name="End Date">
</property>
<property name="Evaluation Type">
<propertyValue name="RCSA"/>
</property>
</bundle>
</resource>
<resource name="/_op_sox/Project/Default/ICDocumentation/Evaluation/Allianz/Allianz SE/Eval_01481.txt"
inheritAcls="true">
<bundle name="AZEvaluation">
<property name="End Date">
</property>
<property name="Evaluation Type">
<propertyValue name="TRA"/>
</property>
</bundle>
</resource>
<resource name="/_op_sox/Project/Default/ICDocumentation/Evaluation/Allianz/Allianz SE/Eval_01362.txt"
inheritAcls="true">
<bundle name="AZEvaluation">
<property name="End Date">
</property>
<property name="Evaluation Type">
<propertyValue name="RCSA"/>
</property>
</bundle>
</resource>
My current regex matches to much.
<resource.+?<propertyValue name="RCSA".+?</resource>
It matches the first resource tag and the second + third.
Can somebody change the regex that it really stops at the first </resource>
I use this Java code
Pattern.compile("<resource.+?<propertyValue name=\"RCSA\".+?</resource>",Pattern.MULTILINE | Pattern.DOTALL)