我有一个字符串列表,我想检查每个字符串是否包含某个子字符串。.net如何找到占位符的子字符串
问题是:应该有允许的占位符。
例如为: 我在寻找 "customer-id", "customer id", "customers id"
- >我的搜索字符串看起来是这样的:"customer{2}id"
(而{2}表示的占位符字符数 - >介于0和2)。
当然,这不会与
teststring.indexof("customer{2}id")
也试过工作:
Dim r as new Regex("customer??id")
但这只是抛出一个嵌套预选赛一些东西例外。 因为我不是正则表达式中的怪胎,我会很感激任何帮助。