G
Guest
I am currently working on a project and need to get a return… even if that
return is a failure. I must also add that I have no control over either the
Regular Expression that will be used or the text file that will be parsed,
and while my text example is XML, there is no guarantee that the text file
will be xml.
This is a portion of the file I am testing with:
<Stock ticker="ACEGX" type="EQUITY" title="VAN KAMPEN STRATEGIC GROWTH
FUND CLASS A" price="44.47" net="-0.01" volume="0" />
<Stock ticker="ACSRX" type="EQUITY" title="VAN KAMPEN COMSTOCK FUND CL R"
price="19.85" net="0.02" volume="0" />
<Stock ticker="ADP" type="EQUITY" title="Automatic Data Processing Inc."
price="50.58" net="-0.11" volume="422600" />
<Stock ticker="AEE" type="EQUITY" title="Ameren Corp." price="53.26"
net="-0.41" volume="129800" />
<Stock ticker="AEP" type="EQUITY" title="American Electric Power Company
Inc." price="45.56" net="-0.39" volume="753100" />
Everything works as it should if I use the Regular Expression:
Stock ticker="(?<ticker>.*?)" type="(?<type>.*?)" title="(?<title>.*?)"
price="(?<price>.*?)" net="(?<net>.*?)" volume="(?<volume>.*?)"
But if I miss 1 space (“net=†instead of “ net=â€) there is no return, it
locks up (I let it run all night, it’s not just slow)… (The bad expression):
Stock ticker="(?<ticker>.*?)" type="(?<type>.*?)" title="(?<title>.*?)"
price="(?<price>.*?)"net="(?<net>.*?)" volume="(?<volume>.*?)"
I need a way to set up the Regex that will not lock up…
Any ideas?
(If this is not the right place to post this question, please let me know
which forum would be better)
return is a failure. I must also add that I have no control over either the
Regular Expression that will be used or the text file that will be parsed,
and while my text example is XML, there is no guarantee that the text file
will be xml.
This is a portion of the file I am testing with:
<Stock ticker="ACEGX" type="EQUITY" title="VAN KAMPEN STRATEGIC GROWTH
FUND CLASS A" price="44.47" net="-0.01" volume="0" />
<Stock ticker="ACSRX" type="EQUITY" title="VAN KAMPEN COMSTOCK FUND CL R"
price="19.85" net="0.02" volume="0" />
<Stock ticker="ADP" type="EQUITY" title="Automatic Data Processing Inc."
price="50.58" net="-0.11" volume="422600" />
<Stock ticker="AEE" type="EQUITY" title="Ameren Corp." price="53.26"
net="-0.41" volume="129800" />
<Stock ticker="AEP" type="EQUITY" title="American Electric Power Company
Inc." price="45.56" net="-0.39" volume="753100" />
Everything works as it should if I use the Regular Expression:
Stock ticker="(?<ticker>.*?)" type="(?<type>.*?)" title="(?<title>.*?)"
price="(?<price>.*?)" net="(?<net>.*?)" volume="(?<volume>.*?)"
But if I miss 1 space (“net=†instead of “ net=â€) there is no return, it
locks up (I let it run all night, it’s not just slow)… (The bad expression):
Stock ticker="(?<ticker>.*?)" type="(?<type>.*?)" title="(?<title>.*?)"
price="(?<price>.*?)"net="(?<net>.*?)" volume="(?<volume>.*?)"
I need a way to set up the Regex that will not lock up…
Any ideas?
(If this is not the right place to post this question, please let me know
which forum would be better)