fork download
  1. #!/bin/bash
  2. 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.'
  3. grep -oE '\<class=[^ ]+' <<< "$s"
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
class=76
class=78
class=76
class=75
class=79.