I would recommend anchoring the regexp to the start of the string, eg:

```ruby
key = rule_class.to_s.sub(/\AYardstick::Rules::/, '').to_sym
```