This is more readable, which is preferred over one-liners, written like so:

```ruby
if resource[:after]
  regex = Regexp.new(resource[:after])
  ...
end
```

It seems like the entire method body should be guarded by `if resource[:after]`, no?  Later one, regex is sent messages, but it might be nil as currently implemented.