title: grep pattern from file, print the pattern instead matched string
body: <p>I want to grep with patterns from file containing regex.
  When the pattern matches, it prints the matched stringa but not the pattern.
  How can I get the pattern instead matched strings?</p>
  
  <p>pattern.txt</p>
  
  <pre><code>Apple (Ball|chocolate|fall) Donut
  donut (apple|ball) Chocolate
  Donut Gorilla Chocolate
  Chocolate (English|Fall) apple gorilla
  gorilla chocolate (apple|ball)
  (ball|donut) apple
  </code></pre>
  
  <p>strings.txt</p>
  
  <pre><code>apple ball Donut
  donut ball chocolate
  donut Ball Chocolate
  apple donut
  chocolate ball Apple
  </code></pre>
  
  <p>This is grep command</p>
  
  <pre><code>grep -Eix -f pattern.txt strings.txt
  </code></pre>
  
  <p>This command prints matched strings from strings.txt</p>
  
  <pre><code>apple ball Donut
  donut ball chocolate
  donut Ball Chocolate
  </code></pre>
  
  <p>But I want to find which patterns were used to match from pattern.txt</p>
  
  <pre><code>Apple (Ball|chocolate|fall) Donut
  donut (apple|ball) Chocolate
  </code></pre>
  
  <p>The pattern.txt can be lower cases, upper cases, line with regex and without, free numbers of words and regex elements. There is no other kind of regex than brackets and pipe.</p>
  
  <p>I don't want to use loop to read pattern.txt each line to grep as it's slow.
  Is there way to print which pattern or line number of pattern file in grep command? or any other command than grep can do the job not too slow?</p>