#!/bin/bash
s='This is my=test and class=76 This is my=test and class=78 This is my=test2 and \n class=76 This is my=test3 and class=75 This is my=test1 and class=79.'
grep -oE '\<class=[^ ]+'  <<< "$s"