adding regex with global flag to "replace" function that prepares result item class