I think I'd personally prefer this to be `/\/r\/([-\w\.]*)\/?` to make the last slash optional and to make the regex a little more restrictive.