tsuji
I don't like the look of the regex using greedy match
In the complete code the RegExp is non-greedy as it spans multiple lines.
title=" language:(.|\s)*?<\/la
Alerting the length or escaping the string is a good ideal.
It didn't occur to me to do this as normally I would have used Perl...
Thanks to everyone for their help, I knew that it was something very simple as well as stupid on my part. Thanks for putting me in the right direction.
tsuji,
After taking another look, i went with what you had suggested and took it a step further. I didn't write the code that is being parsed, I think a bunch of monkeys got loose in a computer lab and created the code many years ago. As usual instead of a re-write my manager wants to" fix...
tsuji
The array is built using a regular Expression that is parsing a page of code. So each element of the array should be represented correctly.
var titleLang = new Array;
var language = new RegExp('title=" language:.*', "gi");
while ((getTitleLang = (language .exec(searchResults))) != null)...
Thanks i really appreciate the help; I added the following alert just before the if statement alert(this[i]+" "+ b[j]). Even when the values are identical the code steps over the if code block.
I've have previously tried using the not equal operator as opposed to is equal operator. This resulted in nothing being written to array b. That is what led me to using the continue statement to break the iteration upon finding a match. I don't understand why the code as originally written does...
Thanks for your input mmerlinn, here is bit more detail.
My intention is to prototype a unique function for arrays that returns a new array without duplicate elements. I believe that a unique function was added to JavaScript 1.5, but I'm coding this for IE, hence I'm stuck using JavaScript...
the following code is not working. it appears the statement that evaluates array elements is not working as i intended.
But if i hard code a value in place of one the elements the code works as intended.What am i missing? code is pasted below.
Array.prototype.unique = function()
{
var i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.