When I'm doing the equivalent test in e-books, the pattern goes-- category by category--
(<div class = "(?:\w+ )*|\bdiv\.)(?!AAA|BBB)
where AAA, BBB etc. are classes to be excluded. With or without trailing " depending on whether I need to remain alert for compound classes. If you use hyphens in class names it would of course have to be [\w-]+ instead.