MoshiachNow
IS-IT--Management
HI,
Having a string like:
<?xml version="1.0" encoding="utf-16"?><DATADOC><GROUP NAME="Chunk"><PARAM NAME="StartJobCommand"></PARAM><GROUP
NAME="Job"><PARAM NAME="SplitLevel" IT="I64">0</PARAM><PARAM NAME="StartDocCommand"></PARAM><GROUP NAME="Doc"><PARAM NAM
E="DocIndex" IT="I64">1</PARAM><PARAM NAME="NumOfPagesInDoc" IT="I64">12512</PARAM><PARAM NAME="FileLocation" SRSID="1">
D:\Output\NJobs\binder1_10443\binder1.pdf</PARAM><PARAM NAME="StartPageCommand"></PARAM><GROUP NAME="Page"><PARAM NAME="
CjfPageIndex" PdlPageIndex="1" IT="I64
I need to extract the file type - in this case "pdf" : binder1.pdf
However the below regex is not good enough,since it eats up all the string till the last accurance of "</PARAM> :
$fileType =~ m!"FileLocation"\s*SRSID=".+?">.*?\\\.(.*?)\</PARAM\>!;
$fileType = $1;
Need an advice here .
thanks
Long live king Moshiach !
Having a string like:
<?xml version="1.0" encoding="utf-16"?><DATADOC><GROUP NAME="Chunk"><PARAM NAME="StartJobCommand"></PARAM><GROUP
NAME="Job"><PARAM NAME="SplitLevel" IT="I64">0</PARAM><PARAM NAME="StartDocCommand"></PARAM><GROUP NAME="Doc"><PARAM NAM
E="DocIndex" IT="I64">1</PARAM><PARAM NAME="NumOfPagesInDoc" IT="I64">12512</PARAM><PARAM NAME="FileLocation" SRSID="1">
D:\Output\NJobs\binder1_10443\binder1.pdf</PARAM><PARAM NAME="StartPageCommand"></PARAM><GROUP NAME="Page"><PARAM NAME="
CjfPageIndex" PdlPageIndex="1" IT="I64
I need to extract the file type - in this case "pdf" : binder1.pdf
However the below regex is not good enough,since it eats up all the string till the last accurance of "</PARAM> :
$fileType =~ m!"FileLocation"\s*SRSID=".+?">.*?\\\.(.*?)\</PARAM\>!;
$fileType = $1;
Need an advice here .
thanks
Long live king Moshiach !