Actually, I want to replace all matched string used as a key of given object to find the value using javascript regular expression. For example: we have string as
hello,how are you???!!OH!! i am fine. what about you, !!FRIEND!!? I am !!GOOD!!.
and object is like var mapper={"OH":"oh+","FRIEND":"friend+","GOOD":"good+"}
Then output should be like:
hello,how are you???OH+ i am fine. what about you, FRIEND+? I am GOOD+.
As starting and ending !! sign will be replaced with only + sign in the end.
var mapper={"OH":"oh+","FRIEND":"friend+","GOOD":"good+"};
data=data.replace(new RegExp("!![A-Z]*!!", 'g'),modifiedSubstring);
I am new to use regular expression but tried some code as placed above. In this expression what should I write instead of modifiedSubstring.
!!with a+.