Skip to content
Advertisement

JS Regex to find href of several a tags

I need a regex to find the contents of the hrefs from these a tags :

JavaScript

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

Example at: http://regexr.com?333d1

Update: or easier via non greedy method:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement