I need to create a validation using regex

Using ruby 2.6.1, rails 6.0.3.4
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.
/^[A-Za-z0-9]+(?:[.\/\s-][A-Za-z0-9]+)*$
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