var reg = "\(d{3}\)"; var ab = "(067)1234567".replace(reg, "код");
var reg = /\(\d{3}\)/; var ab = "(067)1234567".replace(reg, "код"); alert(ab); var reg = "\\(\\d{3}\\)"; reg = new RegExp(reg) var ab = "(067)1234567".replace(reg, "код"); alert(ab);