C# Regex to match the word with dot

后端 未结 3 1771
名媛妹妹
名媛妹妹 2020-12-01 12:10

The quick brown fox jumps over the lazy dog\" is an English-language pangram, alphabet! that is, a phrase that contains all of the letters of the alph

3条回答
  •  春和景丽
    2020-12-01 12:36

    . is a special character in regular expressions. You need to escape it with a slash first:

    Regex.Matches(entireText, "alphabet\\.")
    

    The slash ends up being double because \ inside a string must in turn be escaped with another slash.

提交回复
热议问题