我有一个失败的程序,因为我的10,000 xml文件中的一个在&后面没有分号。我不知道哪个档案。
The reference to entity "L" must end with the ';' delimiter.
在命令行(linux)上是否有办法对& L进行正则表达式搜索并不以分号结尾?
或者快速脚本会更好用吗?
答案 0 :(得分:1)
grep --color=auto -P '&[\w#]+(?![\w#;])' *.xml
或者,如果您只想要文件名:
grep -lP '&[\w#]+(?![\w#;])' *.xml