I am really bad when it comes to using regexp, so please bear with me on this one.
I have piece of ActionScript code which is supposed to evaluate a string of HTML and break it up into individual pieces. So a string like <p>Hi</p><span>Hi</span><a href="index.php">Hi</a> would be translated into:
1. <p>Hi</p>
2. <span>Hi</span>
3. <a href="index.php">Hi</a>
...
However, when I run a test version of this code, I get a value of null in return. I'm pretty sure my regexp string is good, but I'm doing something wrong in ActionScript. Could you please point in the right direction? My code is below:
var evaluatedInput:RegExp = new RegExp('/<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>/');
var output:Object = evaluatedInput.exec("<p>Hi</p><span>Hi</span><a href=\"index.php\">Hi</a>");
trace(output);
Thank you for your time,
spryno724