a="mjj"
b="ni"
if a=="mjj":
print b, a
' \xe9\x8d\x8f\xe3\x84\xa7\xe6\x82\x86\xe6\xb6\x93\xe7\xbb\x98\xe6\xba\x80\xe6\xb5\x9c\xe3\x82\x86\xe7\xa5\xa6\xe7\x92\x81\xe5\x93\x84\xe6\xbd\xa7 \xe7\xbc\x87\xe5\xba\xa1\xe6\xb5\x97\xe9\x8f\x88\xe5\xb6\x85\xe5\xa7\x9f\xe9\x8d\xa3\xe2\x95\x9b\xe7\xbc\x87\xe5\xba\xa1\xe6\xb5\x97VPS_\xe5\xa8\x86\xd1\x84\xe5\xba\x8a\xe9\x8f\x88\xe5\xb6\x85\xe5\xa7\x9f\xe9\x8d\xa3- Powered by Discuz!'
print re.compile(r'<title>(.*?)</title>',re.DOTALL).findall(hl)[0]
print re.compile(r'<title>(.*?)</title>',re.DOTALL).findall(hl)[0].decode("gbk","ignore").encode("utf-8","ignore")
全球主机交流论坛 美国服务器_美国VPS_欧洲服务器 - Powered by Discuz!

Pattern pattern = Pattern.compile("(.+?)"); //正则规则
Matcher matcher = pattern.matcher(d); //应用正则
if(matcher.find()){
System.out.print("Title : ");
System.out.println(matcher.group(1)); //输出
全球主机交流论坛 美国服务器_美国VPS_欧洲服务器 - Powered by Discuz!
Title: 全球主机交流论坛 美国服务器_美国VPS_欧洲服务器 - Powered by Discuz!
原帖由 chairo 于 2011-9-18 02:06 发表
>>> print re.compile(r'(.*?)',re.DOTALL).findall(hl)[0].decode("gbk","ignore").encode("utf-8","ignore")
鍏ㄧ悆涓绘満浜ゆ祦璁哄潧 缇庡浗鏈嶅姟鍣╛缇庡浗VPS_娆ф床鏈嶅姟鍣- Powered by Discuz!
>>> print ...
原帖由 qiqi13245 于 2011-9-18 01:53 发表
2011·09·18 00:15更新:睡覺去了,還在論壇上的各位用力頂阿!前十位+分
順便求人品能追到CH!
本來應該發自己blog的 不過大陸那台免備硬碟掛了 先發 論壇上吧。
======================================================= ...

原帖由 Kokgog 于 2011-9-18 13:45 发表
java是万物皆class,python是万物皆object.......其实控java的可以玩下scala,完成楼主这个功能行数和python差不多........
| 欢迎光临 全球主机交流论坛 (https://loc.516000.xyz/) | Powered by Discuz! X3.4 |