Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.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
Regex 如何检查条件正则表达式语句中的完整单词?_Regex_If Statement_Conditional_Xpath - Fatal编程技术网

Regex 如何检查条件正则表达式语句中的完整单词?

Regex 如何检查条件正则表达式语句中的完整单词?,regex,if-statement,conditional,xpath,Regex,If Statement,Conditional,Xpath,处理此文本: <li><a href="html/Inpatient/3,40060.html"> Informaci<font color="red">ó</font>n para los maestros y la escuela</a></li> 但最终选择被分割成几块,而这场比赛并没有进行。有什么想法吗 正确的使用方法: 或在壳中: xmllint --html --xpath '//a[font[@color="

处理此文本:

<li><a href="html/Inpatient/3,40060.html"> Informaci<font color="red">ó</font>n para los maestros y la escuela</a></li>
但最终选择被分割成几块,而这场比赛并没有进行。有什么想法吗

正确的使用方法:

或在壳中:

xmllint --html --xpath '//a[font[@color="red"]]' file |
    grep -o 'html">'
输出:
请提供预期输出预期输出是否匹配“html”>,这取决于“font color=“red”是否存在。不确定如何解释它…否则,请通过制作另一个标题为“预期输出”的代码块来解释。我会在几分钟后更新我的答案
//a[font[@color="red"]]
xmllint --html --xpath '//a[font[@color="red"]]' file |
    grep -o 'html">'
html">