I have following JS regex which breaks the code and not working as it should.
var loginFailedRegex = /https:\/\/encore.lsbu.ac.uk\/iii\/cas\/login;jsessionid=[a-z0-9]*?service=https%3A%2F%2Flispac.lsbu.ac.uk%3A443%2Fpatroninfo~S1%2FIIITICKET/i;
if (loginFailedRegex.text(decodeURI(loc))) {
zoomPagePortion(100, 100);
}
The loginFailedRegex has only [a-z0-9]* as regex and other whole string is static.
I think the regex problem is here
you should probably have
Assuming that
?is a literal in the URL that you are looking for you need to escape it in your regex.Also you need to change
texttotestassuming that is not just a typo in your post.Here is a test page to verify
http://jsfiddle.net/cordsen/uVnZz/