Fix regex and add class assignment