I’m using codemirror for some user inputted groovy text and before I submit the form to the server I want to add a semicolumn after every closed curly bracket. The way I’m doing it now is:
editor.getValue().replace(/}/g,"};")
This works fine if there are no }; already in the text I’m submitting. Is there any way to extend my regex to ignore this specific string combination(};) before I replace?
This should work :
and to account for spaces between } and ;