extracting value from a file using ant

Viewed 12139

The following lines are present in the file. I would like to extract multiple data from this file.

Number of current user build lists: 23

  • 'RevisionBuild' Run time (in minutes) = 8.40

[Build] RC = 0

I used the following regex to retrieve the value 23 from this file

<ac:for param="line" list="${logFileContent}" delimiter="${line.separator}">
  <sequential>                          
<propertyregex property="noOfBuildlists"
         input="@{line}"
     regexp="(.*)Number of current user build lists: (.*)$"
     select="\2"/>  
  </sequential>
</ac:for>

But the same regex does not fetch any value when i try to fetch the other lines such as regexp="(.)[revBuild] RC = (.)$" or regexp="(.)'RevisionBuild' Run time (in minutes) = (.)$" where the extracted values should be 0 and 8.40 respectively.

Can someone please help? Thanks, Aarthi

2 Answers
Related