正则表达式匹配 a href链接,和input里面的value值
2016-03-01 13:56
399 查看
1、匹配a链接
$aaaa='<a href="TL0002.aspx?L_Id=BL0000001927&RId=" target="_blank">s</a>';
$preg1 = '/<a(.*) href="TL0002.aspx(.*)>.*<\/a>/'; //正则href链接
preg_match_all($preg1,$aaaa,$arr);
2、匹配input里的value值
$bbb = '<input name="lineCount" type="hidden" id="lineCount" value="113" />';
$pre = '<input name="lineCount" type="hidden" id="lineCount" value="(\d*)" />';//正则匹配value值
preg_match_all($pre,$[b]bbb
,$arr);
[/b]
$aaaa='<a href="TL0002.aspx?L_Id=BL0000001927&RId=" target="_blank">s</a>';
$preg1 = '/<a(.*) href="TL0002.aspx(.*)>.*<\/a>/'; //正则href链接
preg_match_all($preg1,$aaaa,$arr);
2、匹配input里的value值
$bbb = '<input name="lineCount" type="hidden" id="lineCount" value="113" />';
$pre = '<input name="lineCount" type="hidden" id="lineCount" value="(\d*)" />';//正则匹配value值
preg_match_all($pre,$[b]bbb
,$arr);
[/b]
相关文章推荐
- fluidity install on Cluster
- UILabel 整理
- UIButton 整理
- ThreadPoolExecutor使用和思考(上)-线程池大小设置与BlockingQueue的三种实现区别
- 探秘Java中String、StringBuilder以及StringBuffer
- SPOJ QTREE4 - Query on a tree IV 树分治
- UIKit框架(20)表格视图UITableView
- iOS-UIScrollView拉伸效果
- BIOS与UEFI、MBR和GPT(转)
- 一个UIButton控件的状态设置和事件的执行
- GUI 关于JComboBox的用法
- IOS-55-UILable文字两边对齐的实现方式
- .Net Telerik Web UI 安装和使用入门
- 关于requirejs和grunt压缩合并是否矛盾
- UITabbar相关
- DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
- mssql-异常value '0000-00-00' can not be represented as java.sql.Date
- Windows Vista下UIPI和Windows消息的故事
- 让一个正方形View以四个角中的任意一角为起点放大或缩小
- UITabBarController