I have a couple of div containers with similar classes. The pattern for start and end is the same for field-*-preview. I need a wildcard for the middle.
This also works so far, but with multiple classes it is the case that if there is another class behind the class (field-*-preview), this element is not recorded.
var sel = $('[class*=field-][class$=-preview]').length
console.log(sel)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="field-1-preview row-1 col-md-4"></div>
<div class="field-2-preview"></div>
<div class="field-3-preview"></div>
<div class="field-4-preview"></div>