[問題] Regular expression quiz

看板Python作者 (jerry2603)時間4年前 (2020/05/08 22:35), 4年前編輯推噓1(101)
留言2則, 1人參與, 4年前最新討論串1/2 (看更多)
各位大大好: 最近在練習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

05/10 21:41, 4年前 , 1F
4/12 前後的$要用\$,這個寫到有match的話會變色,可以先
05/10 21:41, 1F

05/10 21:41, 4年前 , 2F
寫幾個比較小的來測試
05/10 21:41, 2F
文章代碼(AID): #1UjMuNEO (Python)
文章代碼(AID): #1UjMuNEO (Python)