I have the following regex that I use in my routes.rb for /type-in-something-here
# A-Z, a-z, 0-9, _ in the middle but never starting or ending in a _ # At l
validates :name, format: { with: /\A[a-zA-Z]+\z/, message: "Only letters are allowed" }