Boost logo

Boost Users :

From: Sean Lee (yg-boost-users_at_[hidden])
Date: 2002-09-12 15:27:44


I am currently trying to use Regex++ and I almost got there.
However, I try to use Regex++ with XML parser and I got some problem.

Here is the xml expression.
<subtree name="itinerary"
regex="(&lt;\\s*TR\\s*VALIGN=TOP&gt;\\s*&lt;TD\\s*WIDTH=250&gt;\\s*&lt;\\s*B
\\s*&gt;[^&gt;]+AM&lt;/B&gt;?)">

Since "<" and ">" are not valid in XML Syntax, I have to use "&lt;" and
"&gt;".

I have loaded the xml file in my program and did following thing.

char* regex=NULL;
_bstr_t strRegex;

strRegex=pIXMLDOMNode->text; //
regex="(&lt;\\s*TR\\s*VALIGN=TOP&gt;\\s*&lt;TD\\s*WIDTH=250&gt;\\s*&lt;\\s*B
\\s*&gt;

//[^&gt;]+AM&lt;/B&gt;?)">

regex = (char*)malloc(_bstr_t(strRegex).length());
lstrcpy(regex,strRegex);

AfxMessageBox(regex); // got the same string.

But when I compared with following string and I got "FALSE".
char*
temp="(<\\s*TR\\s*VALIGN=TOP>\\s*<TD\\s*WIDTH=250>\\s*<\\s*B\\s*>[^>]+AM</B>
?)";
if(lstrcmp(temp,regex)==0)

Please help me.
Thank you very much.

Sean Lee
slee_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net