var subject = "Parametre - Bloc Notes"
var match = Regex.Match(subject, "(?i)(?:blah|para|foo).*?");
// This will work
//"Para" doesn't match "Param" and it is before the dash
var subject = "Parametre - Bloc Notes"
var match = Regex.Match(subject, "(?i)(?:blah|blo|foo).*?");
// This will not work
// "Blo" match "Bloc" and it is after the dash
我認爲「 - 」,是我誤解的主要原因。正則表達式的匹配,破折號在主題字符串
編輯:
我真的很抱歉,所以我想正則表達式,以破折號前匹配帕拉姆,我該怎麼辦呢?
編輯2:
我承認我的問題是真的含糊不清,所以我的目標是要找到任何字符串Parametre字。
什麼是真正的問題? – jmar777
什麼是實際問題? –
@BradM哈,打你5秒:) – jmar777