How can I test whether a Ruby string contains only a specific set of characters?
For example, if my set of allowed characters is \"AGHTM\" plus digits <
\"AGHTM\"
This seems to be faster than all previous benchmarks (by @Eric Duminil)(ruby 2.4):
!string.match?(/[^AGHTM0-9]/)