如何显示<a> after <span> after <b> tag data in my listbox1?

时间:2015-08-20 10:37:47

标签: regex split

How show all b tag data in the list box area if below position available?

<pre>
 <a class="account-group js-account-group js-action-profile js-user-profile-link js-nav" href="/SectionSyndica" data-user-id="2461389152">
    <img class="avatar js-action-profile-avatar" src="https://pbs.twimg.com/profile_images/459312647012229120/pYPrhPl2_bigger.jpeg" alt="">
    <strong class="fullname js-action-profile-name show-popup-with-id" data-aria-label-part="">Section Syndicale</strong>
    <span>‏</span><span class="username js-action-profile-name" data-aria-label-part=""><s>@</s><b>SectionSyndica</b></span>

  </a>

</pre>
<pre>
 <a class="account-group js-account-group js-action-profile js-user-profile-link js-nav" href="/SectionSyndica" data-user-id="2461389152">
    <img class="avatar js-action-profile-avatar" src="https://pbs.twimg.com/profile_images/459312647012229120/pYPrhPl2_bigger.jpeg" alt="">
    <strong class="fullname js-action-profile-name show-popup-with-id" data-aria-label-part="">olikyekso dieo</strong>
    <span>‏</span><span class="username js-action-profile-name" data-aria-label-part=""><s>@</s><b>olikyeksodkd</b></span>

  </a>

</pre>

Result show below process in my listbox

sectionsyndica

olikyeksodkd

This code not working what I am try for working!!!

HtmlElementCollection bdColld = webBrowser1.Document.GetElementsByTagName("span");
foreach (HtmlElement bdEld in bdColld)
{
if (bdEld.GetAttribute("b") != null)
listBox1.Items.Add(bdEld.GetAttribute("b"));
}

1 个答案:

答案 0 :(得分:0)

如果你想使用正则表达式,你可以使用下面的模式

/<b>(.*?)<\/b>/g