title: Grep key-value pairs where key name is equal to value name
body: <p>I am looking for a way to find key-value pairs where the key name equals the value name using find and grep or some equivalent command line tool avaliable in Linux, e.g.:</p>
  
  <pre><code>find . -type f -exec grep ... {} +
  </code></pre>
  
  <p>Matches to find (among others):</p>
  
  <pre><code>&lt;video autoplay=autoplay loop=loop muted=muted playsinline=playsinline&gt;
  </code></pre>
  
  <p><strong>Background:</strong></p>
  
  <p>I am using <a href="https://harpjs.com/" rel="nofollow noreferrer">harpjs</a> for my website. Unfortunately, jade code like the following gets compiled to html code with key-value pairs where the key name equals the value name. This leads to problems, for example, in iOS Safari, where the the controls are shown in the html5 background video.</p>
  
  <pre><code>video(autoplay, loop, muted, playsinline)
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>I decided to approach the problem another way by analysing the jade code instead of the compiled html code. AFAIK, the following commands cover all cases where jade code might lead to html attributes with value names equal to attribute names:</p>
  
  <pre><code># matches "(autoplay, "
  find harp/public -type f -iname "*.jade" -exec grep --color '([a-zA-Z]*, ' \{\} +
  
  # matches ", loop,"
  find harp/public -type f -iname "*.jade" -exec grep --color ', [a-zA-Z]*,' \{\} +
  
  # matches ", playsinline)"
  find harp/public -type f -iname "*.jade" -exec grep --color ', [a-zA-Z]*)' \{\} +
  
  # matches "(loop)"
  find harp/public -type f -iname "*.jade" -exec grep --color '([a-zA-Z])' \{\} +
  </code></pre>