I am new to angular js . I have regex
which gets all the anchor tags
. My reg ex is
/]*>([^<]+)<\\/a>/g
You need to capture the group inside the anchor tags. The regular expression already matches the inner group ([^<]+)
But, when matching there are different ways to extract that inner text.
When using the Match function it will return an array of matched elements, the first one, will match the whole regular expression and the following elements will match the included groups in the regular expression.
Try this:
var reg = /]*>([^<]+)<\/a>/g
reg.exec(str)[1]
Also the match function will return an array only if the g flag is not present.
Check https://javascript.info/regexp-groups for further documentation.