How to perform RegEx using Twig?
<p>Is it possible to regex on a string in twig?</p>

<p>My string is </p>

<pre><code>&lt;a class="twitter-timeline" data-dnt="true" href="https://twitter.com/example" data-widget-id="2374937989837"&gt;Tweets by @example&lt;/a&gt;
&lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt;
</code></pre>

<p>and I want to fetch just the </p>

<pre><code>data-widget-id="2374937989837"
</code></pre>

<p>in my template.</p>

<p>The string is outputted as {{ this.theme.twitter }}</p>

<p>I have my regex for this search as</p>

<pre><code>id="\d+(\.\d+)*(,\d+)?"
</code></pre>