var str = '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'; str = str.replace(/(.+)content="(.+);(.+)/, '$1content="ololo;$3'); alert(str);