Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用regex从文件中提取信息并需要帮助_Html_Regex - Fatal编程技术网

Html 使用regex从文件中提取信息并需要帮助

Html 使用regex从文件中提取信息并需要帮助,html,regex,Html,Regex,我有一个html文件,它有一个信息表,我试图提取特定的列。模式如下,交替使用“TableDarkRow”和“TableLightRow”: 我试着想出了这个: >([0-9])+</A>(.*)NOWRAP> ?([0-9]{2}\/[0-9]{2}\/[0-9]{4}) >([0-9])+(*)NOWRAP>?([0-9]{2}\/[0-9]{2}\/[0-9]{4}) 但是(.*)允许在第一次和最后一次出现之间选择整个文档。试试这个(尚未测试): 将*替换为*?进

我有一个html文件,它有一个信息表,我试图提取特定的列。模式如下,交替使用“TableDarkRow”和“TableLightRow”:

我试着想出了这个:

>([0-9])+</A>(.*)NOWRAP> ?([0-9]{2}\/[0-9]{2}\/[0-9]{4})
>([0-9])+(*)NOWRAP>?([0-9]{2}\/[0-9]{2}\/[0-9]{4})
但是
(.*)
允许在第一次和最后一次出现之间选择整个文档。

试试这个(尚未测试):


*
替换为
*?
进行非贪婪匹配


参考资料:

您可以将
*
替换为“[A-Za-z'\t]+”

817338284254611
01/14/2011
>([0-9])+</A>(.*)NOWRAP> ?([0-9]{2}\/[0-9]{2}\/[0-9]{4})
/[0-9\/ ]+/