我有一个包含这些行的 HTML 文件 -
<script>PrintFileURL("13572_BranchInformationReport_2012-06-29.xml","13572_BranchInformationReport_2012-06-29.zip",0,"184277","Jun 29 1:30","/icons/default.gif")</script>
<script>PrintFileURL("13572_BranchInformationReport_2012-07-02.zip","13572_BranchInformationReport_2012-07-02.zip",0,"184302","Jul 2 1:30","/icons/default.gif")</script>
<script>PrintFileURL("13572_IndividualInformationReportDelta_2012-06-29_033352.zip","13572_IndividualInformationReportDelta_2012-06-29_033352.zip",0,"53147","Jun 29 3:33","/icons/default.gif")</script>
<script>PrintFileURL("13572_IndividualInformationReportDelta_2012-07-02_033458.zip","13572_IndividualInformationReportDelta_2012-07-02_033458.zip",0,"62719","Jul 2 3:35","/icons/default.gif")</script>
<script>PrintFileURL("13572_IndividualInformationReport_2012-07-01.acc","13572_IndividualInformationReport_2012-07-01.zip",0,"4033364","Jul 1 12:50","/icons/default.gif")</script>
我需要从这个字符串中提取文件名 -
13572_IndividualInformationReportDelta_2012-06-29_033352.zip
13572_IndividualInformationReportDelta_2012-07-02_033458.zip
13572_BranchInformationReport_2012-07-02.zip
13572_BranchInformationReport_2012-07-02.xml
13572_IndividualInformationReport_2012-07-01.acc
现在我正在使用以下正则表达式代码 -
var fileNames = from Match m in Regex.Matches(pageSource, @"[0-9]+_+[A-Za-z]+_+[0-9]+-+[0-9]+-+[0-9]+\.+(acc|zip|app|xml|def|enr|exm|fpr|pnd|trm)")
select m.Value;
它给了我最后 3 个文件,但没有给我前 2 个文件。
有人可以为我提供一个正则表达式来提取所有这些文件吗?
提前致谢 :)