楼主: zhengyusu
2228 6

[问答] UCBerkeley python网课正则表达式题目求助 20论坛币酬谢! [推广有奖]

  • 0关注
  • 0粉丝

高中生

57%

还不是VIP/贵宾

-

威望
0
论坛币
557 个
通用积分
0
学术水平
1 点
热心指数
1 点
信用等级
0 点
经验
185 点
帖子
16
精华
0
在线时间
49 小时
注册时间
2011-1-14
最后登录
2023-12-5

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
各位大神,小弟最近在上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.


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



二维码

扫码加我 拉你入群

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

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

关键词:UCBerkeley Berkeley python 20论坛币 正则表达式 python 正则表达式

沙发
floydgyf 在职认证  发表于 2015-1-13 09:26:41 |只看作者 |坛友微信交流群
你这都不动脑想想,你上网课岂不是浪费时间吗,意义何在?

使用道具

藤椅
zhengyusu 发表于 2015-2-3 11:33:21 |只看作者 |坛友微信交流群
floydgyf 发表于 2015-1-13 09:26
你这都不动脑想想,你上网课岂不是浪费时间吗,意义何在?
你哪里看出来我没想的?

使用道具

板凳
floydgyf 在职认证  发表于 2015-2-3 16:14:22 |只看作者 |坛友微信交流群
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。

使用道具

报纸
floydgyf 在职认证  发表于 2015-2-3 16:14:23 |只看作者 |坛友微信交流群
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。

使用道具

地板
floydgyf 在职认证  发表于 2015-2-3 16:14:27 |只看作者 |坛友微信交流群
zhengyusu 发表于 2015-2-3 11:33
你哪里看出来我没想的?
这么简单的问题还要问,岂不就是想都没想。

使用道具

7
zhengyusu 发表于 2015-2-9 21:50:02 |只看作者 |坛友微信交流群
floydgyf 发表于 2015-2-3 16:14
这么简单的问题还要问,岂不就是想都没想。
简单不简单没有绝对的说法,大学生觉得微积分简单,对于小学生就是难。且不说你懂却不帮助初学者,就是这种摆出一副卫道先生的态度就让人恶心。另外,我已经早都自己做出来了。多谢!

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 04:34