title: How can I use sed to create this pattern in file
body: <p>I have this file</p>
  
  <pre><code>Array ( [0] =&gt; ROLE_ADMIN@READ@User [1] =&gt; ROLE_ADMIN_DD_USER@READ@User [2] =&gt; ROLE_DD_USER@READ@* [3] =&gt; ROLE_USER@READ@User [4] =&gt; IS_AUTHENTICATED_ANONYMOUSLY@*@User [5] =&gt; *@READ@User [6] =&gt; ROLE_ADMIN@form@User [7] =&gt; *@form@User [8] =&gt; 
  </code></pre>
  
  <p>I want to extract the <code>ROLE_ADMIN@READ@User</code> portions and then make them comma separated.</p>
  
  <p><code>[ ROLE_ADMIN@READ@User , ROLE_ADMIN@READ@User ]</code></p>
  
  <p>I have tried this in <code>sed</code></p>
  
  <pre><code>sed -re 's/ ([A-Z_\*]*)@([A-Za-z\*]*)@[a-z\*]*/#/g' role.txt
  </code></pre>
  
  <p>This is half done; I am not sure what to do next.  Can you help?</p>