regex - Powershell Select-String 包含通配符
问题描述
我需要使用 Select-String 来查找已知字符串,后跟 a/
或$
后跟另一个已知字符串。
所以假设文字字符串 1 是X
文字字符串 2 是Y
,我如何查找字符串X/Y
或X$Y
在 powershell 中?
解决方案
PS C:\users\js> Echo a/b | Select-String a.b
a/b
PS C:\users\js> Echo 'a$b' | Select-String a.b
a$b
推荐阅读
- javascript - Vue:将插槽内的所有数据读/写为一个
- html - 如何为输入框设置颜色
- java - 如何将图像从 URL 调整为 JPanel
- python - 以编程方式删除 Python 中的所有蓝牙设备
- reactjs - Heroku 持续集成 (CI) 未能通过 react-scripts 构建
- c++ - 在双向链表中删除小于给定值的值
- python - 将图像加载到 `np.array` 中,强制 `0..255` RGB 值到 `0.00..1.00` 浮点值?
- r - R Difference between source and load
- python - 使用 Django SafeString 支持实现类似 f-string 的语法
- java - 通过 JButton 将 ArrayList 打印到 JTextField