如何获得href值使用冷灌注? [英] how to get href value using coldfusion?

查看:148
本文介绍了如何获得href值使用冷灌注?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    <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>

我只需要获得 http://www.cnn.com 如何做到

推荐答案

@ Bhargavi:你的正则表达式很好。
尝试 #matches [1]#

@Bhargavi : Your regex is fine. Try #matches[1]# instead.

< cfdump var =#matches#> 将显示可以相应地操作结果的值的数组。

<cfdump var="#matches#"> will show you the array of values on which the results can be manipulated accordingly.

这篇关于如何获得href值使用冷灌注?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆