1 #coding=utf-8 2 import re 3 import chardet#检测网页编码形式的模块 4 5 p = re.compile(r'\d+') 6 print p.findall('one1two2three3four4') 7 8 a="rewfd2313...
分类:
编程语言 时间:
2014-08-25 22:37:14
阅读次数:
259
@RequestMapping(value="ddd.do")publicvoidddd(HttpServletResponseresponse){try{List<AsWp>list=asWpService.findAll();HSSFWorkbookwb=export(list);response.setContentType("application/vnd.ms-excel");response.setHeader("Content-disposition","p_w_upload;fil..
分类:
编程语言 时间:
2014-08-24 10:22:22
阅读次数:
213
import?meetweb.net.util.SpecialAdapter;
。。。。。
private?SpecialAdapter?simpleAdapter?=?null;
public?void?ShowData(){?
RateList?=?rateService.findAll();
System.out.println(RateList);
LV...
分类:
移动开发 时间:
2014-08-21 19:47:24
阅读次数:
171
labelEx($model,'project_id',array('class' => 'control-label')); ?> findAll(); $list = CHtml::lis...
分类:
其他好文 时间:
2014-08-15 12:18:08
阅读次数:
164
摘自网络,综合自己的理解: 函数名原型详解返回类型注意事项re.matchimport re re.match(pattern,string,flags)pattern:正则表达式,匹配成功,返回一个Match,否则返回一个None string:要匹配的字符串 flags...
分类:
其他好文 时间:
2014-07-29 10:27:38
阅读次数:
218
1、正则表达式分析日志提取信息字符匹配:普通字符:大多数字符和字母一般都会和自身匹配如正则表达式test会和字符串‘test’完成匹配元字符:.^$*+?{}[]\|()re模块findall用法:用法1:s=‘helloworld‘p=‘hello‘re.findall(p,s)用法2:s=‘helloworld‘r=re.compile(r‘hello‘)r.f..
分类:
编程语言 时间:
2014-07-21 19:35:02
阅读次数:
257
#encoding=utf-8from xml.etree import ElementTree as ET#要找出所有人的年龄per=ET.parse('d:\\1.xml')p=per.findall('./STATION')for x in p: print x.attribprintf...
分类:
其他好文 时间:
2014-07-18 15:05:41
阅读次数:
187
#!/usr/bin/pythonimportredefbuffer_line():buf=open("/etc/sae/buffer_1").read()ifnotbuf:return0else:returnint(re.findall("^\d*",buf)[0])defset_last_pos(pos):open("/etc/sae/buffer_1","w").write(str(pos))if__name__==‘__main__‘:appname={}fh=open("/data0/l7.acce..
分类:
编程语言 时间:
2014-07-14 16:41:57
阅读次数:
319
Beatiful Soup生成商品详情页面的剖析树,主要函数:findAll(name=None, attrs={}, recursive=True, text=None, limit=None, **kwargs)利用findAll先获取标签范围的内容,再利用正则表达式进行匹配输出。Beatifu...
分类:
其他好文 时间:
2014-07-03 23:04:31
阅读次数:
260
在学习Mybatis3过程中遇到一个小问题,觉得需要注意就把它写下来了在查询所有数据的时候方法是这样的public List findAll(){ .....}在它的user.xml文件中的sql语句没有参数,返回的类型不是list,而是List中的User
分类:
其他好文 时间:
2014-06-30 14:42:05
阅读次数:
205