【发布时间】:2015-02-27 01:23:21
【问题描述】:
我有以下字符串:
In order to take this course, you must:<br>
<br>
√ Have access to a computer.<br>
<br>
√ Have continuous broadband Internet access.<br>
<br>
√ Have the ability/permission to install plug-ins (e.g. Adobe Reader or Flash) and software.<br>
<br>
√ Have the ability to download and save files and documents to a computer.<br>
<br>
√ Have the ability to open Microsoft file and documents (.doc, .ppt, .xls, etc.).<br>
<br>
√ Be competent in the English language.<br>
<br>
√ Have access to a relational database management system. A good open-source option is MySQL (<a href="http://dev.mysql.com" target="_blank">dev.mysql.com</a>).<br>
<br>
√ Have completed the Discrete Structures course.<br>
<br>
√ Have read the Student Handbook.
我正在尝试选择中间的文本(不包括标题、编码空格和<br>s),例如,第一个匹配项应该是:Have access to a computer.
我尝试了以下两个,但无法使其工作。
这个选择整行:^(?:&radic;([(&nbsp;)|\s]*))(.*)(?:(\<br\\?\>)*)$,我尝试调用Regex.Matches(requirements.InnerHtml, RequirementsExtractorRegex, RegexOptions.Multiline)[0].Captures[0].Value,这里是值:&radic; &nbsp; &nbsp;Have access to a computer.<br>。
而且这个没有选择任何东西:^(?<=&radic;([(&nbsp;)|\s]*))(.*)(?=(\<br\\?\>)*)$
我做错了什么?
【问题讨论】:
-
你的意思是,除了使用正则表达式解析HTML,你还做错了什么?你肯定见过“RegEx match open tags except XHTML self-contained tags”吗?