作者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://www.ptt.cc/bbs/Python/M.1588948503.A.398.html
※ 編輯: smith2603 (36.236.131.170 臺灣), 05/08/2020 22:42:01
推 Pomay: 4/12 前後的$要用\$,這個寫到有match的話會變色,可以先 05/10 21:41
→ Pomay: 寫幾個比較小的來測試 05/10 21:41