这是我的问题
,我正在尝试删除 HTML 标签,简单地格式化它们(例如每个信息的新行),然后编写其他程序以稍后提取有用的信息。
到目前为止,我已将数据读入一个大字符串数组。
这是我的想法:找到 <> 中的所有标签并将它们替换为空白。在网上查了一下,我看到了一些可以做查找和替换部分的程序。
因为不同的HTML标签有不同的长度,所以我想知道C++中有没有一种方法可以检测标签的任何长度,只要它在<>中。然后更换它们。
这是 HTML 的一个示例代码
<div style="width: 200px;"><strong>Balance Sheets (USD $)<br></strong></div>
我希望在手术后得到:
Balance Sheets (USD $)
有人可以帮忙吗?或者有没有人有更好的主意来处理这个任务?任何帮助是极大的赞赏!
<DOCUMENT>
<TYPE>XML
<SEQUENCE>33
<FILENAME>R2.htm
<DESCRIPTION>IDEA: XBRL DOCUMENT
<TEXT>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link rel="StyleSheet" type="text/css" href="report.css"><script type="text/javascript" src="Show.js">/* Do Not Remove This Comment */</script></head>
<body><span style="display: none;">v2.4.0.6</span><table class="report" border="0" cellspacing="2" id="ID0EQAAG">
<tr>
<th class="tl" colspan="1" rowspan="1">
<div style="width: 200px;"><strong>Balance Sheets (USD $)<br></strong></div>
</th>
<th class="th">
<div>Dec. 31, 2012</div>
</th>
<th class="th">
<div>Dec. 31, 2011</div>
</th>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_tpoi_CurrentAssetsAbstract', window );"><strong>Current assets:</strong></a></td>
<td class="text"> <span></span></td>
<td class="text"> <span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_CashAndCashEquivalentsAtCarryingValue', window );">Cash and cash equivalents</a></td>
<td class="nump">$ 106,999<span></span></td>
<td class="nump">$ 52,109<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_AccountsReceivableNetCurrent', window );">Accounts receivable</a></td>
<td class="nump">110,720<span></span></td>
<td class="nump">61,218<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_tpoi_AccountsReceivableRelatedParty', window );">Accounts receivable - related party</a></td>
<td class="nump">1,527<span></span></td>
<td class="text"> <span></span></td>
</tr>
<tr class="reu">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_AssetsCurrent', window );">Total current assets</a></td>
<td class="nump">219,246<span></span></td>
<td class="nump">113,327<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_PropertyPlantAndEquipmentNet', window );">Property and equipment, net</a></td>
<td class="nump">152,724<span></span></td>
<td class="nump">160,454<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_CapitalizedSoftwareDevelopmentCostsForSoftwareSoldToCustomers', window );">Capitalized software development costs</a></td>
<td class="nump">188,371<span></span></td>
<td class="text"> <span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_IntangibleAssetsNetExcludingGoodwill', window );">Intangible assets, net</a></td>
<td class="nump">59,151<span></span></td>
<td class="nump">59,151<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_OtherAssetsCurrent', window );">Other assets</a></td>
<td class="nump">11,622<span></span></td>
<td class="nump">15,470<span></span></td>
</tr>
<tr class="rou">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_NoncurrentAssets', window );">Total long term assets</a></td>
<td class="nump">411,868<span></span></td>
<td class="nump">235,075<span></span></td>
</tr>
<tr class="reu">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_Assets', window );">Total assets</a></td>
<td class="nump">631,114<span></span></td>
<td class="nump">348,402<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_tpoi_CurrentLiabilitiesAbstract', window );"><strong>Current liabilities:</strong></a></td>
<td class="text"> <span></span></td>
<td class="text"> <span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_AccountsPayableCurrent', window );">Accounts payable</a></td>
<td class="nump">50,866<span></span></td>
<td class="nump">70,253<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_AccruedLiabilitiesCurrent', window );">Accrued liabilities</a></td>
<td class="nump">1,452<span></span></td>
<td class="nump">6,752<span></span></td>
</tr>
<tr class="reu">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_Liabilities', window );">Total current liabilities</a></td>
<td class="nump">52,318<span></span></td>
<td class="nump">77,005<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_OtherAccruedLiabilitiesNoncurrent', window );">Other non current liabilities, accrued interest</a></td>
<td class="nump">7,500<span></span></td>
<td class="nump">1,500<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_NotesPayableCurrent', window );">Notes payable</a></td>
<td class="nump">50,000<span></span></td>
<td class="nump">50,000<span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_DueToRelatedPartiesCurrent', window );">Notes payable - related party</a></td>
<td class="nump">100,000<span></span></td>
<td class="nump">100,000<span></span></td>
</tr>
<tr class="reu">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_OtherLiabilitiesCurrent', window );">Total long-term liabilities</a></td>
<td class="nump">157,500<span></span></td>
<td class="nump">151,500<span></span></td>
</tr>
<tr class="rou">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_LiabilitiesCurrent', window );">Total liabilities</a></td>
<td class="nump">209,818<span></span></td>
<td class="nump">228,505<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_tpoi_ShareholdersEquityAbstract', window );"><strong>Shareholders’ equity:</strong></a></td>
<td class="text"> <span></span></td>
<td class="text"> <span></span></td>
</tr>
<tr class="ro">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_CommonStockValue', window );">Common stock, $0 par value, 30,000,000 shares authorized, 13,312,302 and 9,312,302 shares issued and outstanding at December 31, 2012 and 2011, respectively</a></td>
<td class="nump">1,542,651<span></span></td>
<td class="nump">946,151<span></span></td>
</tr>
<tr class="re">
<td class="pl" style="border-bottom: 0px;" valign="top"><a class="a" href="javascript:void(0);" onclick="top.Show.showAR( this, 'defref_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment', window );">Accumulated deficit</a></td>
<td class="num">(1,145,758)<span></span></td>
<td class="num">(837,310)<span></span></td>
</tr>
**Many many HTML code here...... Many Many Many**
<td><strong> Name:</strong></td>
<td><nobr>us-gaap_StockholdersEquity</nobr></td>
</tr>
<tr>
<td style="padding-right: 4px;"><nobr><strong> Namespace Prefix:</strong></nobr></td>
<td>us-gaap_</td>
</tr>
<tr>
<td><strong> Data Type:</strong></td>
<td>xbrli:monetaryItemType</td>
</tr>
<tr>
<td><strong> Balance Type:</strong></td>
<td>credit</td>
</tr>
<tr>
<td><strong> Period Type:</strong></td>
<td>instant</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
</TEXT>
</DOCUMENT>
代码是这样的,但要长得多