one way to clean this up would be to use a regex:

```ruby
if input =~  /(\^|\*|\&|\[|\])/ || input.nil?
```
You should use input.nil? instead of input.empty? because you are expecting a string, not an enumerable.