gpt4 book ai didi

regex - 为什么 apt-cache search 会找到与给定正则表达式不匹配的包?

转载 作者:太空宇宙 更新时间:2023-11-03 16:50:51 24 4
gpt4 key购买 nike

我在 linux bash 上运行了以下命令:

apt-cache search 'hex.*(view|edit)'

我的目的是找到名称/描述中包含模式“hex.*(view|edit)”的任何软件包。但在我得到的结果中:

kipi-plugins - image manipulation/handling plugins for KIPI aware programs

这怎么会出现在结果列表中?我没有在此结果中看到任何匹配的字符串。这是 apt-cache search 命令的错误吗?还是我误解了此命令如何使用正则表达式?

最佳答案

search 对包描述中的所有文本进行全文搜索,而不仅仅是名称。如果只需要名称,可以使用 --names-only

关于regex - 为什么 apt-cache search 会找到与给定正则表达式不匹配的包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2944104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com