全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 python论坛
2545 6
2015-01-08
各位大神,小弟最近在上UC Berkeley python的网课,有几道题关于regular expression的不知道该怎么下手,希望大家能帮帮忙:

1. Write a regular expression that will match strings that are either all lower case or all upper case. Assume that the string is a single word that is at least two letters long and consists only of letters. For example, it will match AM, PM, am or parrot but NOT match Am, aM, Pm or Parrot.


2. Write a substitution command that will change names like file1, file2, etc. to file01, file02, etc. but will not add a zero to names like file10 or file20.


3.Many news and mail readers automatically highlight URLs that appear in text, for example http://yahoo.com or www.msnbc.com. Construct a regular expression that will extract the names of URLs embedded in a string.


4. Write a function that takes times of the form 03:12:19 (in other words, three hours, twelve minutes, and nineteen seconds) and converts them to the corresponding number of seconds.


小弟在这里多谢大家帮忙!



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-1-13 09:26:41
你这都不动脑想想,你上网课岂不是浪费时间吗,意义何在?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-3 11:33:21
floydgyf 发表于 2015-1-13 09:26
你这都不动脑想想,你上网课岂不是浪费时间吗,意义何在?
你哪里看出来我没想的?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-3 16:14:22
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-3 16:14:23
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-3 16:14:27
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群