问题
<cfoutput>
<cfsavecontent variable="s">
This is some text. It is true that <a href="http://www.cnn.com">Harry Potter</a> is a good
</cfsavecontent>
<cfset matches = reMatch("<[aA].*?>",s) />
#matches#
</cfoutput>
I need to get only "http://www.cnn.com" how to do this
回答1:
@Bhargavi : Your regex is fine.
Try #matches[1]#
instead.
<cfdump var="#matches#">
will show you the array of values on which the results can be manipulated accordingly.
来源:https://stackoverflow.com/questions/22704786/how-to-get-href-value-using-coldfusion