 <p>Here is my suggestion:</p> <pre><code>\[[\w\s&amp;.-]*\]'[\w\s&amp;.-]+'![A-Z]{1,4} </code></pre> <p>In JS:</p> <pre><code>var re = /\[[\w\s&amp;.-]*\]'[\w\s&amp;.-]+'![A-Z]{1,4}/gi; </code></pre> <p><code>[\w\s&amp;.-]*</code> will match all alphanumeric characters and <code>_</code> with spaces, <code>&amp;</code>, <code>.</code> and <code>-</code>. The <code>[A-Z]{1,4}</code> will match 1 to 4 uppercase English letters. The <code>i</code> option will make matching case-insensitive. If you want to allow digits in the last part, just revert them to <code>[A-Z0-9]{1,4}</code>.</p> <p>See <a href="https://regex101.com/r/oE1yV9/3" rel="nofollow">demo</a></p>