Skip to content

Commit

Permalink
Simplify %r rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Mar 12, 2015
1 parent b77446c commit bdde52a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -3341,19 +3341,16 @@ resource cleanup when possible.
```

* <a name="percent-r"></a>
Use `%r` only for regular expressions matching *more than* one '/'
Use `%r` only for regular expressions matching *at least* one '/'
character.
<sup>[[link](#percent-r)]</sup>

```Ruby
# bad
%r(\s+)

# still bad
%r(^/(.*)$)
# should be /^\/(.*)$/

# good
%r(^/(.*)$)
%r(^/blog/2011/(.*)$)
```

Expand Down

0 comments on commit bdde52a

Please sign in to comment.