- PowerShell 教程
- PowerShell - 主页
- PowerShell - 概述
- PowerShell - 环境设置
- PowerShell - Cmdlet
- PowerShell - 文件和文件夹
- PowerShell - 日期和计时器
- PowerShell - 文件 I/O
- PowerShell - 高级 Cmdlet
- PowerShell - 脚本编写
- PowerShell - 特殊变量
- PowerShell - 运算符
- PowerShell - 循环
- PowerShell - 条件
- PowerShell - 数组
- PowerShell - 哈希表
- PowerShell - 正则表达式
- PowerShell - 反引号
- PowerShell - 括号
- PowerShell - 别名
- PowerShell 有用资源
- PowerShell - 快速指南
- PowerShell - 有用资源
- PowerShell - 讨论
Powershell - 正则表达式 - 匹配量词
以下是 Windows PowerShell 中受支持量词的示例
#Format: * #Logic Specifies zero or more matches; for example, \wor (abc). Equivalent # to {0,}. "abc" -match "\w*" #Format: + #Logic: Matches repeating instances of the preceding characters. "xyxyxy" -match "xy+" #Format: ? #Logic: Specifies zero or one matches; for example, \w? or (abc)?. # Equivalent to {0,1}. "abc" -match "\w?" #Format: {n} #Logic: Specifies exactly n matches; for example, (pizza){2}. "abc" -match "\w{2}" #Format: {n,} #Logic: Specifies at least n matches; for example, (abc){2,}. "abc" -match "\w{2,}" #Format: {n,m} #Logic: Specifies at least n, but no more than m, matches. "abc" -match "\w{2,3}"
以上所有命令的输出均为 True。
powershell_regex.htm
广告