actually I want to replace a string except if it comes in a round bracket.
For example:
JAVA is a nice language. (JAVA) has lots of features. JAVA is portable. (JAVA) even comes in 64 bit.
now if i replace JAVA with C:
then desired output is :
C is a nice language. (JAVA) has lots of features. C is portable. (JAVA) even comes in 64 bit.
even java can come as a sub string like
XJAVAX is a nice language. (XJAVAX) has lots of features. JAVA is portable. (JAVA) even comes in 64 bit.
now if i replace JAVA by C :
Then expected output :
XCX is a nice language. (XJAVAX) has lots of features. C is portable. (JAVA) even comes in 64 bit.
Since JavaScript doesn’t have look-behind, the easiest way is probably an alternation:
Beyond that, you get into trying to simulate look-behind, which is possible in some ways, but messy.