Find ID or Class attributes in HTML Regex \s(id|class)="[^"]+" Test https://regexper.com/#%5Cs(id%7Cclass)%3D%22%5B%5E%22%5D%2B%22