NotePad ++使用REGEX Pattern of Delimiters获取单词
我目前正在使用此REGEX来获取前缀为PRE_的整个单词 \b(PRE_)\S* 这适用于大多数情况,但我想处理特殊字符是单词的一部分时的情况,例如句号,逗号或其他特殊字符。,; - {}()[] 例如,这里的话: PRE_samplewordwithoutdelimiter PRE_sampleword.otherwordsnotincluded; PRE_Sampleword{}...deleted PRE_complexword()a.;.is deleted Somewords ahead PRE_sometext() ending in other words Words with bracket [PRE_brackettext] are deleted PRE_sampleword is spaced out so deleted sampleword.PRE_deleted; notdeleted.notdeleted.PRE_ 我只希望找到一个分隔词的第一部分。所以我可以删除或替换这个词。因此,在使用“”作为文本替换此场景中的所有PRE_前缀单词的情况下,我会得到: <DELETED> <DELETED>.otherwordsnotincluded; <DELETED>{}...deleted <DELETED>()a.;.is deleted Somewords ahead <DELETED>() ending in other words Words with bracket [<DELETED>] are …