F
Fred
Hi,
I would like to get an array of <a> html tags og a string.
I have done this but it doesnt works :
var reg;
var str='Bonjour, ceci est un test, une <a href="phrase.php">phrase</a>
décrivant un <img src="mot.gif" alt="mot"> assez <a
href="important.php">important</a>';
reg=new RegExp('<a [^<|>]+>([^<|>]*)<\/a>', "gi");
matchstr=reg.exec(str);
if (matchstr == null)
alert("No match");
else
{
alert(matchstr.length);
for (var i = 0; i < matchstr.length; i++)
{
alert(matchstr);
}
}
My BUG :
matchstr only contains <a href="phrase.php">phrase</a> bu not <a
href="important.php">important</a> !!
How to do then ?
Thanks for any help on it !
Regards
Fred
I would like to get an array of <a> html tags og a string.
I have done this but it doesnt works :
var reg;
var str='Bonjour, ceci est un test, une <a href="phrase.php">phrase</a>
décrivant un <img src="mot.gif" alt="mot"> assez <a
href="important.php">important</a>';
reg=new RegExp('<a [^<|>]+>([^<|>]*)<\/a>', "gi");
matchstr=reg.exec(str);
if (matchstr == null)
alert("No match");
else
{
alert(matchstr.length);
for (var i = 0; i < matchstr.length; i++)
{
alert(matchstr);
}
}
My BUG :
matchstr only contains <a href="phrase.php">phrase</a> bu not <a
href="important.php">important</a> !!
How to do then ?
Thanks for any help on it !
Regards
Fred