 <pre><code>s = ["hello how are you?", "I am fine.What are you doing?", "Hey, I am having a haircut. See you at Hotel KingsMen at 10 am."] s.join.scan(/Hotel\s(.+)?\sat\s(.+)?\./).flatten #=&gt; ["KingsMen", "10 am"] </code></pre> <p>Regex description:</p> <ol> <li><p><code>\s</code> - any whitespace character, </p></li> <li><p><code>.</code> - any character, <code>.+</code> - one or more of any character, <code>()</code> - capture everything inside, so <code>(.+)</code> - capture one or more characters</p></li> <li><p><code>a?</code> means zero or one of <code>a</code></p></li> </ol>