I have string input like following:
<Name>IncludeLeafPortfolios</Name><DataType>Boolean</DataType><Value>True</Value>
<Name>HierarchyDate</Name><DataType>Int</DataType><IsFixed>false</IsFixed>
<Name>HierarchyDate</Name><DataType>Int</DataType>
<Name>HierarchyDate</Name><DataType>Int</DataType><Value>0</Value><IsFixed>false</IsFixed>
<Name>HierarchyDate</Name><DataType>Int</DataType><Value>0</Value><IsFixed>false</IsFixed>
Name tag always exist and is of interest. DataType is not of interest. Value tag and IsFixed tag may or may not exist. The goal is to capture Value tag, IsFixed tag if one of them exists or both exist.
My solution is not working:
$element =~ m/^<Name>([\w\s]*)<\/Name>.*([<Value>[\w+\d+]<\/Value>]?)(<IsFixed>[\w+]<\/IsFixed>])?$
Please suggest. Thanks.