I am using Ruby on Rails 3.1.0 and I would like to validate a class attribute just to avoid to store in the database a string containing these characters: (blank space), <, >, ", #, %, {, }, |, \, ^, ~, [, ] and “`.
What is the regex?
Assuming it should also be non-empty:
Since someone is downvoting this, here is some test code:
Output: