I currently have this in my script and I am not really sure why it isn't working. It works on a regex tester and it's quite a simple regular expression.
var page = '<div id="loginOverlay" class="loginOverlay">' +
'<div id="loginForm">' +
'<form name="loginForm" method="post" action="/test.jspx" onsubmit="grayLoginAnonymous();return false;" style="margin:0px;" autocomplete="off"><input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value="21a9e5a4197cfaefec409d8473f29a6e" />'+
' </form>'+
' </div> '+
' </div>';
var pattern = /<input type='hidden' name='org.apache.struts.taglib.html.TOKEN' value='((\d|\w)+)' \/>/;
var match = page.match(pattern);
document.write(match);
console.log(page);
console.log(match);
</script>
match returns 'null'. Can someone point out the problem?
.means "any character" in regular expressions. So while it will also match a literal dot, you should be more specific and write\.if you want a regex to match an actual dot.