I think

highway = tertiary & ref ~ '[0-9][0-9][0-9][0-9][A-Z]' 

should work, means, it should match for way 188220733.

So, maybe the problem is to find the negation? That would be

highway = tertiary & !(ref ~ '[0-9][0-9][0-9][0-9][A-Z]')