如何形成适用于 Ands 和 Ors 的查询 Select

How to form a Query Select That Works With Ands and Ors

我有一个 class 定义的 HtmlElements 如下:

<div class="GM BOLTA 2016" >
<div class="GM BOLTB 2016" >
<div class="GM BOLT 2015" >
<div class="FORD BOLT 2016" >

我希望能够针对此创建查询选择器,具体来说,我想知道所有 div 具有 GM 的标签以及任何以 BOLT 开头但不是 2015 年的标签。

我在想

[GM][^BOLT]!2015 

但显然错了

I'd like to know all div tags that have GM and also have anything that starts with BOLT and is not 2015.

普通 Javascript:

var matches = document.querySelectorAll('.GM, [class^="BOLT"]:not(.2015)');

jQuery:

$('.GM, [class^="BOLT"]:not(.2015)')