作者smith2603 (jerry2603)
看板Python
标题[问题] Regular expression quiz
时间Fri May 8 22:34:45 2020
各位大大好:
最近在练习regular expression表示法,找了一些网站在做练习
有一个网站
http://play.inginf.units.it/#/里面提供了一个Game可以做regular expression
共有12题,我只有6题能拿到满分,其他几题我花了三天的时间还是解不出来,
所以上来求救,请大大们有空的话帮忙解答一下,因为网站没提供解答,
没解出来很难过,先谢过各位!下面我先提供已经知道的可能解法
1/12 task your_regex:\d+
2/12 task your_regex:\b(\w+:){5}\w+\b
3/12 task your_regex:ftp://ftp[\w/d.]+
4/12 task
5/12 task your_regex:(\d{2,3}\.){3}\d{1,3}
6/12 task your_regex:href=(".+?")|href=('.+?')
7/12 task
8/12 task your_regex:<h\d>?.+
9/12 task
10/12 task
11/12 task
12/12 task
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 36.236.131.170 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1588948503.A.398.html
※ 编辑: smith2603 (36.236.131.170 台湾), 05/08/2020 22:42:01
1F:推 Pomay: 4/12 前後的$要用\$,这个写到有match的话会变色,可以先 05/10 21:41
2F:→ Pomay: 写几个比较小的来测试 05/10 21:41