While there is a place for defensive programming, it also adds overhead and obfuscates the code. I would rather have this be specific in what it accepts and ensure that we only give it the correct data rather than always guess.

If there is a demonstrable chance that nil will be passed, it would be better to do something like this:

```ruby
case s
when NilClass
  false
when String
  # regex
when Fixnum
  true
end
```