Why my regex does not work when using beginning and end of string anchors?
<p>I have developed the following regex trying to match a string with at least one digit and at least one lowercase character.</p>

<pre><code>(?=.*[a-z])(?=.*\d)
</code></pre>

<p>This seems to be working OK. For example it matches 'abc3' and not 'abc'</p>

<p>However as soon as I modify the regex by adding the beginning and end of string anchors it stops working. Would you know why?</p>

<pre><code>^(?=.*[a-z])(?=.*\d)$
</code></pre>