I need a regex to find the contents of the hrefs from these a tags :
JavaScript
x
4
1
<p class="bc_shirt_delete">
2
<a href="/CustomContentProcess.aspx?CCID=13524&OID=3936923&A=Delete" onclick="javascript:return confirm('Are You sure you want to delete this item?')">delete</a>
3
</p>
4
Just the urls, not the href/ tags.
I’m parsing a plain text ajax request here, so I need a regex.
Advertisement
Answer
You can try this regex:
JavaScript
1
2
1
/href="([^'"]+)/g
2
Example at: http://regexr.com?333d1
Update: or easier via non greedy method:
JavaScript
1
2
1
/href="(.*?)"/g
2