如果它不是以“@”开头,我需要替换单词中的 replaceString
。
例如:
replaceString - replaced to : replacedString
abc.replaceString - replaced to : abc.replacedString
abc.@replaceString - NOT replaced
我正在尝试使用类似 @"(?!@)replaceString$"
的东西,但它无法正常工作。
最佳答案
使用后视而不是前视:
(?<!@)replaceString$
关于c# - 用正则表达式替换部分单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30910493/