如何使用带有正则表达式的ID从表中获取内容? [英] How do I get content from a table using its ID with a regex?
本文介绍了如何使用带有正则表达式的ID从表中获取内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要对html字符串进行排序,以便获得我需要的内容。现在我需要遍历具有ID的表中的表行。如何使用正则表达式执行此操作?
I need to sort a html string so I get the content I need. Now I need to loop through the table rows in a table that have an ID. How do I do this with a regex?
推荐答案
正则表达式不能用于解析HTML; HTML不常规。使用正确的HTML解析器库。
Regular expressions cannot be used to parse HTML; HTML is not regular. Use a proper HTML parser library.
这篇关于如何使用带有正则表达式的ID从表中获取内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文