If the information to be removed is always at the end of the note then adding a $ to the end of the replacement regex may help as well. That will prevent it from grabbing things mid-note, only removing from the very end.
If doing that it should be: note.value.replace('\[.*@.*\]\s*$', '')
If the information to be removed is always at the end of the note then adding a $ to the end of the replacement regex may help as well. That will prevent it from grabbing things mid-note, only removing from the very end.
If doing that it should be: note.value. replace( '\[.*@. *\]\s*$ ', '')