Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:06:26+00:00 2026-05-26T00:06:26+00:00

I am trying to parse data from a very long html content. I am

  • 0

I am trying to parse data from a very long html content. I am just pasting here the important part I am interested in:

Technical Details

<div class="content">

    <ul style="list-style: disc; padding-left: 25px;">

      <li>1920x1080 Full HD 60p/24p Recording w/7MP still image</li>
      <li>32GB Flash Memory for up to 13 hours (LP mode) of HD recording</li>
      <li>Project your videos on the go anywhere, anytime.</li>
      <li>Wide Angle G lens to capture everything you want.</li>
      <li>Back-illuminated "Exmor R" CMOS sensor for superb low-light video</li>

    </ul>

  <div id="technicalProductFeatures"></div>

I need to start parsing from :

<div class="content">

til

<ul

and then until

</ul>

I have tried following regex but it did not work:

Regex specsRegex = new Regex ("<div class=\"content\">[\\s]*<ul.[\\s]*</ul>");

this gives me nothing..

One other issue is sometimes it has a linebreak and sometimes not between initial div and ul tags like:

<div class="content">
<ul style="list-style: disc; padding-left: 25px;">

or

<div class="content">

<ul style="list-style: disc; padding-left: 25px;">

thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:06:27+00:00Added an answer on May 26, 2026 at 12:06 am

    I wouldn’t suggest using regular expressions for this. It’s like trying to fix a tire with a hammer. The hammer is a good tool, but it’s not for everything.

    I’d use Html Agility Pack. It’s not clear to me exactly what you’re looking to extract. But I’ll assume it’s the list items. So you’d do something like this…

    var hdoc = new HtmlAgilityPack.HtmlDocument();
    hdoc.LoadHtml(YourHtmlGoesHere);
    
    var MatchingNodes = hdoc.DocumentNode.SelectNodes("/html/body/div/ul/li");
    

    As you can see, the syntax for the Html Agility Pack is based on XPATH and is much simpler for this task. It’s also much more robust and something as silly as nested tags or a comment is not going to throw it off. Those types of things can throw off even the most carefully written regular expression in this scenario.


    UPDATE

    If you were determined to create a quick & dirty regular expression for this, it’d be something like this…

    <div class="content">.*?</ul>
    

    Ordinarily the .*? part matches anything except lines feeds 0 or more times, as few times as possible. So be sure to use RegexOptions.Singleline so that the . will match line feeds as well. This should work for the example you’ve given, but a commented bit of code with </ul> in it could throw it off, or a nested <ul></ul> could throw it off as well.

    UPDATE #2

    This will grab everything between the <ul></ul>…

    (?<=<div class="content">\s*<ul[^>]*>).*?(?=</ul>)
    

    Again, be sure to use RegexOptions.Singleline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse the output from a tool into a data structure but
I'm trying to parse data from Archive.org's search functionality. The data looks like this:
I am trying to parse out data from oodle.com api feed using the JSON.NET
I'm trying to parse data from a page of JSON in my ASP.NET MVC
I was trying to parse response data from web server. I am using Xcode
I'm trying to parse some JSON data from the Google AJAX Search API. I
I am trying to parse a data file in ANTLR - it has optional
I'm trying to parse some data returned by a 3rd party app (a TSV
I am trying to parse form data, including upload files with a node.js http
I am trying to parse a CSV file containing some data, mostly numeral but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.