I'm working on the following strings:
d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{}; source
the same with source repositioned (this is a good case to catch source):
d.innerHTML= lala; possibly other stuff; source " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};
I'm trying to capture any case that an innerHTML takes the string "source" in its value. I tried this regex to match anything between the two strings:
innerHTML=(.*?)source
But it fails as it will keep searching for the "source" keyword in the entire page (and will match everything on the way). So I tried setting a limit that represent function end, such as:
innerHTML=(.*?)(source|[})\]\n])
But this also failed, since it still matches anything up until what I've set (remember - I only want to match when source actually exists).
I have no idea how to perform this, without generating false positives whereever "source" is mentioned outside the innerHTML value. Please help?