regex - VSCode 查找所有不包含某个字符的引用
问题描述
如何在我的文件中找到包含< relref "
和不包含/
或#
之后的所有实例"
。
我试过使用正则表达式前瞻,即,< relref "((?!/).)*
但它们在 VSCode 中不受支持
简单来说:
These should match:
{{< relref "blog/foo.md" >}}
{{< relref "blog/2018/10/09/foo.md" >}}
{{< relref "bar.md" >}}
These should not match:
{{< relref "/bar.md" >}}
{{< relref "#anchor" >}}
{{< relref "/foo/bar.md" >}}
解决方案
假设您想要匹配从{{
to的所有内容,这应该可以工作}}
:
{{< relref "[^\/#][^"]*" >}}
推荐阅读
- vue.js - Vue Transitions - 如何执行一次性开启和关闭动画
- ios - 是否可以使用 iOS SDK 更改 Amazon Cognito 中的用户名?
- javascript - 如何修复“加载资源失败:服务器响应状态为 404(未找到)”
- entity-framework - 如何从 EF 的输出中重新执行生成的查询
- python - 带有张量流的 NameError:为什么这不起作用?
- r - R::officer 在 powerpoint 幻灯片中找不到行或 id
- spring - 如何在 requestBody 中为 Spring Boot Rest 控制器传递 MultipartFile
- ios - 我的表格视图单元格上的组件不可见
- python - 有日期限制的汇总信息
- java - 即使我将 ImageView 设置为不可见,ImageView 也不会将其设置为不可见