str = "=43gfvb"; alert(/^(?:\+[+=]|=)\d/.test(str) ? str : null) str = "d43gfvb"; alert(/^(?:\+[+=]|=)\d/.test(str) ? str : null)