Replace part of word with regexp

82 Views Asked by At

I need to replace replaceString inside words, if it not starting with "@".

For example:

replaceString - replaced to : replacedString
abc.replaceString - replaced to : abc.replacedString
abc.@replaceString - NOT replaced

Im trying to use something like @"(?!@)replaceString$", but it not working properly.

1

There are 1 best solutions below

0
On BEST ANSWER

Use a lookbehind instead of lookahead:

(?<!@)replaceString$