I am new to angular js . I have regex which gets all the anchor tags. My reg ex is
/]*>([^<]+)<\\/a>/g
Why are you trying to reinvent the wheel?
You are trying to parse the HTML string with a regex it will be a very complicated task, just use DOM or jQuery to get the links contents, they are made for this.
Put the HTML string as the HTML of a jQuery/DOM element.
Then fetch this created DOM element to get all the a elements
inside it and return their contents in an array.
This is how should be your code:
var str = 'abc.jagadale@gmail.com';
var results = [];
$("").html(str).find("a").each(function(l) {
results.push($(this).text());
});
Demo:
var str = 'abc.jagadale@gmail.com';
var results = [];
$("").html(str).find("a").each(function(l) {
results.push($(this).text());
});
console.log(results);