HTML 查找某文字列 并读取其注释内容 用正则好吗?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='ocr-system' content='tesseract 3.02' />
<meta name='ocr-capabilities' content='ocr_page ocr_carea ocr_par ocr_line ocrx_word'/>
</head>
<body>
<div class='ocr_page' id='page_1' title='image "tamron.new.exp4.TIF"; bbox 0 0 547 70; ppageno 0'>
<div class='ocr_carea' id='block_1_1' title="bbox 28 27 509 54">
<p class='ocr_par' dir='ltr' id='par_1' title="bbox 28 27 509 54">
<span class='ocr_line' id='line_1' title="bbox 28 27 509 54">
<span class='ocrx_word' id='word_1' title="bbox 28 27 76 52">200</span>
<span class='ocrx_word' id='word_2' title="bbox 108 27 200 52">135100</span>
<span class='ocrx_word' id='word_3' title="bbox 228 27 260 52">70</span>
</span>
</p>
</div>
</div>
</body>
</html>
内容如上, 我想查找其文字列“200” 的注释 title="bbox 28 27 76 52" 这一部分 应该怎么找好呢?
如果正则求正则表达式~~(不能与"bbox 108 27 200 52" 里面的200 混淆)
...全文
相关推荐
Html注释 Html中标记文字注释的符号
HTML注释的语法非常简单,通过`<!--`开始,`-->`结束来包裹需要注释的文字。例如:```html<!
java读取html文件,并获取body中所有的标签及内容的案例
Java 读取 HTML 文件并获取 body 中所有的标签及内容的案例Java 读取 HTML 文件并获取 body 中所有的标签及内容是 Web 开发中的一项基本操作。
Python使用正则表达式去除(过滤)HTML标签提取文字功能
在Python编程中,正则表达式是一个强大的工具,用于处理字符串和进行模式匹配。本篇文章主要探讨了如何利用正则表达式去除HTML标签并提取文本内容。
html js 遍历一个文件夹里的指定类型的所有文件,查找文件夹中所有的html文件并可读取内容
本话题主要关注如何使用JavaScript遍历一个文件夹,查找其中的所有HTML文件,并读取它们的内容。这里我们将深入探讨相关技术及其应用。
java正则表达式匹配网页所有网址和链接文字的示例
/a>`:这个正则表达式匹配HTML中所有的`<a>`标签及其内容,`.*?`是非贪婪匹配,尽可能少地匹配字符,直到遇到下一个`/a>`。 - 如果需要匹配网址,可以使用类似`<a href="?'?


