Regex javascript for href matching
3 answers
You can get href
with:
var array_of_matches = str.match(/href="([^"]*")/g)
Look for "href =" ', then run a group to capture all non-double-quoted characters until it ends with a final double-quote. You can output query arguments using more groups within this group.
Take a look at the javascript regex tutorial . And a global flag to get the array of matches described in the string regex api .
+5
a source to share