REMatchGroup() UDF To Return Only Specified Group In RegEx Pattern

<!--- Save our target text. --->
<cfsavecontent variable="strText">
 
	Hey Deborah, you should totally check out the movie,
	<a
	href="http://www.imdb.com/title/tt0096320/"
	title="Twins staring Arnold Schwarzenegger."
	target="_blank"
	>Twins</a>, starring Arnold Schwarzenegger. Obviously,
	some of his classic work. However, if you really want to
	appreciate Arnold for his true greatness, you should
	probably check out <a
	href="http://www.imdb.com/title/tt0076578/"
	title="Pumping Iron staring Arnold Schwarzenegger."
	target="_blank"
	>Pumping Iron</a>. This movie is just crazy awesome!
 
</cfsavecontent>
 
 
<!---
	Extract all the link URLs from the text. We are putting
	the acutal link URL in the only capturing group, which
	will be group 1. This is important since out UDF will
	return only the given group.
--->
<cfset arrURLs = REMatchGroup(
	"(?i)<a[\s\S]+?href=""([^""]+)""[^>]*>",
	strText,
	1
	) />
 
<!--- Dump out the URLs. --->
<cfdump
	var="#arrURLs#"
	label="REMatchGroup() - Link URLs"
	/>

For Cut-and-Paste