# What does %r

**URL:** <https://www.ruby-forum.com/t/what-does-r/150047>\
**Category:** Ruby\
**Created:** [October 2, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/what-does-r/150047 "2008-10-02T21:50:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [October 2, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/what-does-r/150047/1 "2008-10-02T21:50:28Z")

</div>

match = url.match(%r[http://(.+).site.com/a-(\d+).html])  
my question is what is this %r, i know that %w(x 1 2)=[‘x’,‘1’,‘2’] but  
what’s %r,  
can i read more about these percents?  
links please

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [October 2, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/what-does-r/150047/2 "2008-10-02T22:04:50Z")

</div>

John Ab wrote:

> my question is what is this %r

Regex literal. Like // but without the need to escape any slashes in the  
re.

> can i read more about these percents?

> **[Ruby | zenspider.com | by ryan davis](https://www.zenspider.com/ruby/)**
>
> Ruby facts, opinions, source code, links, and stuff.

HTH,  
Sebastian

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [October 2, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/what-does-r/150047/3 "2008-10-02T22:17:20Z")

</div>

thank you very much
