I want to find all @mention
occurrences in a comment and replace them with a different format.
I have this regex that groups all occurrences, but all this point I would have to manipulate these strings for Jira ([~string]
), and plug them back into the original string.
comment.match(/[ ]@[^\s]+/g);
Is there a better way?
Comment entered:
guiyjhk @test hgjhgjh test@this_is.test2 jhgjhgjh @this_is.test2
This is what I want to be returned:
guiyjhk [~test] hgjhgjh test@this_is.test2 jhgjhgjh [~this_is.test2]