Use gsub instead of match