how to get href value using coldfusion?

谁都会走 提交于 2019-12-02 20:19:16

问题


    <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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!