Ruby Regexp.escape weird output
<pre><code>irb(main):021:0&gt; TEXT = &lt;&lt;EOF
irb(main):022:0&quot; Text messaging, or texting, is the act of composing 
and sending electronic messages between two or more mobile phones, or fixed or 
portable devices over a phone network. The term originally referred to messages 
sent using the Short Message Service (SMS). 
It has grown to include multimedia messages(known as MMS) containing images, videos, 
and sound content, as well as ideograms known as emoji
irb(main):023:0&quot; EOF
=&gt; &quot;Text messaging, or texting, is the act of composing and sending electronic 
messages between two or more mobile phones, or fixed or portable devices over a 
phone network. The term originally referred to messages sent using the Short 
Message Service (SMS). It has grown to include multimedia messages (known as MMS) 
containing images, videos, and sound content, as well as ideograms known as emoji\n&quot;

irb(main):064:0&gt; LEXICON = {
irb(main):065:1*   &quot;Text&quot; =&gt; &quot;WRITING&quot;,
irb(main):066:1*   &quot;is&quot; =&gt; &quot;WAS&quot;
irb(main):067:1&gt; }
irb(main):070:0&gt; sanitized = TEXT.gsub(pattern, LEXICON)
=&gt; &quot;WRITING messaging, or texting, WAS the act of composing and sending electronic messages between two or more mobile phones, or fixed or portable devices over a phone network. The term originally referred to messages sent using the Short Message Service (SMS). It has grown to include multimedia messages (known as MMS) containing images, videos, and sound content, as well as ideograms known as emoji\n&quot;
irb(main):071:0&gt; terms = LEXICON.keys.map {|k| Regexp.new(Regexp.escape(k))}.join(&quot;|&quot;)
=&gt; &quot;(?-mix:Text)|(?-mix:is)&quot;    &lt;------------ What is this (?-mix:...) thing?

irb(main):072:0&gt; sanitized = TEXT.gsub(pattern, LEXICON)
=&gt; &quot;WRITING messaging, or texting, WAS the act of composing and sending electronic 
messages between two or more mobile phones, or fixed or portable devices over a 
phone network. The term originally referred to messages sent using the Short 
Message Service (SMS). It has grown to include multimedia messages (known as MMS) 
containing images, videos, and sound content, 
as well as ideograms known as emoji\n&quot;
</code></pre>
<p>I was watching Ruby Tapas, episode <a href="http://www.rubytapas.com/episodes/190-gsub?filter=free" rel="nofollow noreferrer">190</a> and I tried it in an <code>IRB</code> session and it's interesting to me that I'd get a <code>(?-mix:key)|(?-mix:key)</code> after that expression. Can someone explain to me what that is about?</p>