S
samuel
Hi All,
Now I need to analyze a file which is composed of several blocks ,
which is defined as below :
Start
<content>
<content>
.......
<content>
End
And I need to capture all the blocks which contains several
specific keywords "dma" in the content part.
The perl script used as below :
undef $/; # each read is whole file
while (<>) {
# $mycmd ='^START(.*?)dma(.*?)^End/sgm){
print $&;
}
}
However, for below blocks :
Start
cpu
End
Start
dma
End
The RegExp of perl will take these two blocks as one match and print
out. This is not what I want.
I just need the second block print out and don't the first one not.
Does anyone know how to handle this in perl script ?
Many thanks in advance .
Samuel
Now I need to analyze a file which is composed of several blocks ,
which is defined as below :
Start
<content>
<content>
.......
<content>
End
And I need to capture all the blocks which contains several
specific keywords "dma" in the content part.
The perl script used as below :
undef $/; # each read is whole file
while (<>) {
# $mycmd ='^START(.*?)dma(.*?)^End/sgm){
print $&;
}
}
However, for below blocks :
Start
cpu
End
Start
dma
End
The RegExp of perl will take these two blocks as one match and print
out. This is not what I want.
I just need the second block print out and don't the first one not.
Does anyone know how to handle this in perl script ?
Many thanks in advance .
Samuel