I'm facing an issue with a JavaScript regexp and I could really use some assistance.
Currently, I have an ajax query result saved in a variable (in this case, a regexp) and I am trying to only match the content within the fieldset tag.
Here is a snippet of my HTML code:
<fieldset class="form-wrapper" >
<form action="/users/login" id="UserLoginForm" method="post" accept-charset="utf-8"><div style="display:none;">
<input type="hidden" name="_method" value="POST" /></div>
<div class="input text required">
<label for="UserUsername">Username</label>
<input name="data[User][username]" type="text" maxlength="255" id="UserUsername" />
</div>
<div class="input password">
<label for="UserPassword">Password</label>
<input type="password" name="data[User][password]" id="UserPassword" />
</div>
<div class="submit">
<input type="submit" value="Login" />
</div>
</form>
<p id="user-management-links">
<a href="/users/forgotten_password">Forgotten password ?</a>
| <a href="/users/register">Sign up</a>
</p>
</fieldset>
And here are my regular expressions :
This one is working fine:
var regexp = content.match(/<form .*?>(.*?)<\/form>/)[0];
However, this one is not working:
var regexed = content.match(/<fieldset>(.*)<\/fieldset>/)[0];
Thank you in advance for any help you can provide!