Fairly simple HTML (the ellipses indicate that there's more code):
...Profile">
Some text
</a>...
Using on-line RegEx tester for JavaScript (http://regexpal.com/), I can extract "Some text" (note that it contains newlines) with the following expression:
(?=Profile">)[\s\S]*(?=</a)
(Unfortunately, look-behinds are not supported by JavaScript, and so I also extract Something"> to later remove this. The problem is, however, that the below code
var ShowContent = document.getElementById(id);
ShowContent = ShowContent.innerHTML;
var patt3=/Profile">[\s\S]*(?=<)/;
var GetName=patt3.exec(ShowContent);
alert(GetName);
doesn't extract what the on-line tester shows, but also it includes the whole HTML code that is after "Some text" (IE, not only the ending < /a
but also everything after).
Does anyone have any suggestions?