I need to create a validation using regex

Using ruby 2.6.1, rails
Do not allow /n, /t, more than 1 whitespace
Allow only uppercase and lowercase letters, numbers, . - / chars but only between letters and/or numbers.
At the moment have only this.
But still can add a newline or a tab.
Thanks for any help.
Are there any ways to create this validation in another way?

It seem valide but use this: https://rubular.com/ to be sure.
But unless it is for a password, it not very specific. For a usage with a database, you must specifically filter Integer, real, mediumint, etc. to prevent the corruption of the database.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs