result.match() should return an array of strings. It looks like you are only accessing the result at index [1] of the array. You can iterate through this array to get both "From:" strings by storing the result of match() in a variable, and then calling replace() repeatedly.