相关疑难解决方法(0)

使用通配符匹配字符串

我想匹配字符串与通配符(*),其中通配符表示"任何".例如:

*X = string must end with X
X* = string must start with X
*X* = string must contain X
Run Code Online (Sandbox Code Playgroud)

此外,一些复合用途,如:

*X*YZ* = string contains X and contains YZ
X*YZ*P = string starts with X, contains YZ and ends with P.
Run Code Online (Sandbox Code Playgroud)

有一个简单的算法来做到这一点?我不确定使用正则表达式(虽然这是一种可能性).

为了澄清,用户将在上面输入一个过滤器框(尽可能简单的过滤器),我不希望他们自己编写正则表达式.所以我可以很容易地从上面的符号转换出来的东西会很好.

c# regex string wildcard

52
推荐指数
7
解决办法
8万
查看次数

如何为同一台机器自动化 PowerShell 或 PowerShell Core

随着 PowerShell Core 的发布,应用程序在使用托管自动化库 (system.management.automation) 时如何选择调用哪个版本的 Powershell(Powershell 5.x 或 PowerShell Core)?关于应该创建的运行空间的一些事情?或者也许是连接信息?

powershell powershell-core

4
推荐指数
1
解决办法
793
查看次数

标签 统计

c# ×1

powershell ×1

powershell-core ×1

regex ×1

string ×1

wildcard ×1