that is just `string !~ /[^[:print:]]/`

don't you need ^ and $ anchors here as well?