Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个长字符串(html),我想获取 <td> </td> 之间的每个值,例如,我需要字符串“avatr”、“lionking”:
<td>avatar</td> <td> lionking</td> and so on....
因为您正在解析 HTML(一种上下文无关语言),所以您不应该使用正则表达式。有关详细信息,请参阅此帖子。
幸运的是,.NET 有一个很棒的库可用于解析 HTML,称为HTML Agility Pack