regExp = /dialogWidth\s?:\s?\d.px?;?/ig alert("dialogWidth : 50px;".match(regExp));