# \<r:unless\_url matches="/it/"\>

**URL:** <https://www.ruby-forum.com/t/r-unless-url-matches-it/100881>\
**Category:** Radiant CMS\
**Created:** [August 1, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/r-unless-url-matches-it/100881 "2006-08-01T19:51:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [August 1, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/r-unless-url-matches-it/100881/1 "2006-08-01T19:51:27Z")

</div>

Hi. Inside a layout I need to select the home page to avoid showing  
the page title (which should be by default shown on all other pages).  
I thought to use the \<r:unless\_url matches="/it/"\> tag. My site tree  
is organized like the following one:

/

/it/  
/it/benvenuti  
/it/…

/en/  
/en/welcome  
/en/…

The problem is that by singling out the “italian” home page with the  
\<r:unless\_url matches="/it/"\> tag I also get (it matches) all the  
other Italian pages (in other words I’m not being able to  
differentiate the language-specific home page)… Any suggestion on  
how to solve this problem from a regex guru on this list? TIA. --M

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [August 1, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/r-unless-url-matches-it/100881/2 "2006-08-01T20:07:26Z")

</div>

I’m no Regex guru but try this:

\<r:unless\_url matches="^/it/$"\>

I believe ^/$ mark start/end of string.

Hope it helps,

AEM

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [August 1, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/r-unless-url-matches-it/100881/3 "2006-08-01T20:36:39Z")

</div>

Sean, Adrian: many thanks for a working tip …

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [August 1, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/r-unless-url-matches-it/100881/4 "2006-08-01T20:10:27Z")

</div>

Maurizio,

Consider adding $ to the end of your URL regex, i.e.

The $ signifies the end of the string.

Sean C.  
[seancribbs.com](http://seancribbs.com)
