# Exact phrase in include?

**URL:** <https://www.ruby-forum.com/t/exact-phrase-in-include/143279>\
**Category:** Ruby\
**Created:** [July 16, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/exact-phrase-in-include/143279 "2008-07-16T23:20:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/exact-phrase-in-include/143279/1 "2008-07-16T23:20:13Z")

</div>

I have a string that I check with include? There are two words in the  
string that contains the same word of “design”. One is “design” the  
other “designer”. How can I check for an exact phrase of “design”?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2008, 11:30pm UTC](https://www.ruby-forum.com/t/exact-phrase-in-include/143279/2 "2008-07-16T23:30:43Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> I have a string that I check with include? There are two words in the  
> string that contains the same word of “design”. One is “design” the  
> other “designer”. How can I check for an exact phrase of “design”?

string =~ /\bdesign\b/

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/exact-phrase-in-include/143279/3 "2008-07-16T23:43:28Z")

</div>

Sebastian H. wrote:

> PÃ¥l BergstrÃ¶m wrote:
> 
> string =~ /\bdesign\b/

Perfect. Thanks.
