我想替换所有只有一个等号。
var mystr = 'ONE == TWO ... THREE==FOUR ... FIVE = SIX ... SEVEN=EIGHT' ... NINE := TEN;
return mystr.replace(/(?=\=)([=]{1})(?!\=)/gm, '==');
我得到以下信息:
ONE === TWO ... THREE===FOUR ... FIVE == SIX ... SEVEN==EIGHT ... NINE :== TEN
数字 5-6、7-8 都可以。但是,我想要这样:
ONE == TWO ... THREE==FOUR ... FIVE == SIX ... SEVEN==EIGHT ... NINE := TEN
我的正则表达式有什么问题?