3 regex powershell character-class
Lu应该代表Letter, Uppercase,但是我得到了意想不到的结果
PS > 'Hello World' -replace '\p{Lu}', 'Z'
ZZZZZ ZZZZZ
Run Code Online (Sandbox Code Playgroud)
可以看出,Lu正在替换上下字符.
使用-creplace.-replace不区分大小写:
PS > 'Hello World' -creplace '\p{Lu}', 'Z'
Zello Zorld
Run Code Online (Sandbox Code Playgroud)