Answer the question
In order to leave comments, you need to log in
Regular expressions. How to extract text from a site?
Well, I can not understand how these regular expressions are arranged!
In general, there is such a text on satya:
<span>Оператор:</span> *оператор* </div>
<div class="***"><span>Регион:</span> *регион*</div>
Answer the question
In order to leave comments, you need to log in
Regular expressions are not designed for parsing html. Try using specialized tools. For example, read about the AngleSharp library.
There is code and comments
https://www.geeksforgeeks.org/what-is-regular-expr...
here you can test regex regexstorm.net/tester
here examples regexstorm.net/reference
Study the examples and try to compose what you need , as an option, if it’s really tight, then stupidly delete the unnecessary through the search and replace with empty in the line to search only in the text and not in the html markup.
public static string StripHTML(string input)
{
return Regex.Replace(input, "<.*?>", String.Empty);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question