花生鱼's Blog

■╪ 加快奋斗的脚步
 
 

Powered by: 博客园
模板提供:沪江博客
博客园 | 首页 | 发新随笔 | 发新文章 | 联系 | 订阅订阅 | 管理

12 2007 档案

 
js 正则
摘要: match对字符串执行查找,并将包含查找的结果作为数组返回。str.match(/\(\d{10,12}\)/g)[0].replace(/\(|\)/g,"")replace行文字替换后的字符串的复制//去掉所有空格str='啊,b,cdefgh不';varre=newRegExp('\\s+','g');str=str.replace(re,'');//str=str.replace(/\s/...阅读全文
posted @ 2007-12-20 22:08 婲生魚 阅读(47) | 评论 (0) 编辑
[有点点]复杂href获取
摘要: //得到下面字符串里“商品列表”的a的hrefstringpattern=@"<ahref='([^']+)[^<]+'>商品列表";Regexr=newRegex(pattern,RegexOptions.IgnoreCase);MatchCollectionmc=r.Matches(data);foreach(Matchminmc){stringss=...阅读全文
posted @ 2007-12-20 22:00 婲生魚 阅读(629) | 评论 (0) 编辑
得到所有radio的value和text里的数字
摘要: stringpattern=@"(?<=<)input[^>]+name=[""]?payfee[""]?[^>]+value=[""]?(?<value>\w+)[""]?\s?[^>]+>(?<int>\d+)(?=元)";Regexr=newRegex(pattern,RegexOptions.IgnoreCase);MatchCo...阅读全文
posted @ 2007-12-20 21:54 婲生魚 阅读(322) | 评论 (0) 编辑