Is it possible to use
validates_exclusion_of with regular expressions?
That would ensure that URLs matching these specific patterns can't be validated nor inserted into db.
What would be the best approach to code this?
There are a couple ways I might do it, depending on the circumstance.
First, if I am going to have to match some patterns and then exclude others I might do something like this:
Or if you just need to exclude certain patterns
I took Geoff's approach and implemented the following: