javascript regex insert string

Solutions on MaxInterview for javascript regex insert string by the best coders in the world

showing results for - "javascript regex insert string"
Kaliyah
30 Jul 2018
1var str = "Tell us about this interaction. Make sure you mention: (a) what the interaction was about (hangout, chit chat, discuss assignments, etc.) (b) what other things you and/or your friend was doing on the phone during this interaction (c) whether both of you were involved in this other activity and (d) any other information about this interaction you would like to share with us. Avoid using your friends full real name";
2var pat = /\([a-zA-Z]\)/g;
3var out = str.replace(pat, "<br>$&");
4document.write(out);