我有一個字符串列表,我想檢查每個字符串是否包含某個子字符串。.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")
但這只是拋出一個嵌套預選賽一些東西例外。 因爲我不是正則表達式中的怪胎,我會很感激任何幫助。