1 nnnToTnnn 2019-08-26 14:41:03 +08:00 正则我就没输过,我看看我能闯第几关 |
![]() | 2 p8YFk4f3E8SJ3aEv 2019-08-26 14:41:05 +08:00 学完就忘怎么办。。。? |
3 nnnToTnnn 2019-08-26 14:43:21 +08:00 ![]() 尝试了一下,好了,以上当我没说 |
![]() | 4 ipwx 2019-08-26 14:44:21 +08:00 "i dont know regex but i know Javascript bitches" |
![]() | 5 JQZhang 2019-08-26 14:55:06 +08:00 不错,可以练习一下,学习学习 |
![]() | 6 Jex 2019-08-26 15:00:50 +08:00 |
![]() | 7 ptrees 2019-08-26 15:14:35 +08:00 我的工作就是写正则,基本上用不到很复杂的...最复杂恐怕就是匹配多层嵌套的 json 格式里的值了,很多时候直接放弃 |
8 nznd 2019-08-26 16:24:39 +08:00 哇 我在这网站浪费了一下午 XSS PHP 都好有趣(然后打开 github 开始膜拜各种神奇操作 |
9 soulzz 2019-08-26 16:47:02 +08:00 <img src=" ![]() 我太难了 这题我不会啊 |
10 lihongjie0209 2019-08-26 16:51:39 +08:00 @soulzz #9 afoot|catfoot|dogfoot|fanfoot|foody|foolery|foolish|fooster|footage|foothot|footle|footpad|footway|hotfoot|jawfoot|mafoo|nonfood|padfoot|prefool|sfoot|unfool |
![]() | 11 rrfeng 2019-08-26 16:54:55 +08:00 ![]() 这题不叫『写正则』,叫『找规律』 |
![]() | 13 Vegetable 2019-08-26 16:58:36 +08:00 (afoot|catfoot|dogfoot|fanfoot|foody|foolery|foolish|fooster|footage|foothot|footle|footpad|footway|hotfoot|jawfoot|mafoo|nonfood|padfoot|prefool|sfoot|unfool) |
14 annielong 2019-08-26 16:58:41 +08:00 最令人抓狂的就是正则,用起来真方便,写起来真难 |
![]() | 15 liuxey 2019-08-26 16:59:05 +08:00 第一题就劝退,字符包含"foo"? |
![]() | 16 honjow 2019-08-26 17:02:20 +08:00 下面的是不是排行?用的字符越少越排前面?可是有些 0 啊 1 啊 tm 都是作弊的吧。。。 人家都说那么明白了 i dont know regex but i know Javascript bitches #滑稽 |
![]() | 17 AddictX 2019-08-26 17:04:17 +08:00 @lihongjie0209 然而只需要填“ foo ”就 OK 了,就是不知道排行榜上 1 个字符的那群人是怎么弄的。 |
18 nihaoaa 2019-08-26 17:04:49 +08:00 人生已经很难了,为什么还要做这种题增加难度 |
19 soulzz 2019-08-26 17:05:31 +08:00 |
20 lihongjie0209 2019-08-26 17:08:13 +08:00 @soulzz #19 有限个数的直接枚举就好了, 还找规律干嘛。 |
![]() | 21 sm0king 2019-08-26 17:08:14 +08:00 fo{2} ?? |
22 arrow8899 2019-08-26 17:15:41 +08:00 大家来找茬(文字版)?? |
23 junan008 2019-08-26 17:18:44 +08:00 \S?foo\S? |
![]() | 25 AddictX 2019-08-26 17:25:41 +08:00 ![]() @honjow 发现了,这回理解“ i dont know regex but i know Javascript bitches ”的意思了。。。 Warmup: foo Anchors: k$ it never ends: fu\b Ranges: ^[a-f]+$ Backrefs: (\w{3}).*\1 不玩了,玩了一下午,就玩出了这点。Backrefs 还死活压不到 9 个字符,进不去排行榜。。。 |
![]() | 27 quadrapop 2019-08-26 17:41:08 +08:00 3 个全对到下一关? |
![]() | 28 shwomen1234fs 2019-08-26 17:41:16 +08:00 @soulzz 正则判断不包含 abba 类型的字符串 ^(?!.*?(.)(.)\2\1) |
29 soulzz 2019-08-26 17:45:12 +08:00 @shwomen1234fs 大佬 nb 我卡在正则表达式取反了 |
![]() | 30 atx 2019-08-26 17:45:58 +08:00 ^(foo|fan|dog|cat|afo|hot|jaw|maf|non|pad|pre|sf|unfoo) |
![]() | 32 honjow 2019-08-26 17:54:19 +08:00 质数那个咋搞 ^(xx+?)\1+$能匹配非质数(也就是右边),那么怎么取反? |
![]() | 35 luzemin 2019-08-26 18:03:16 +08:00 题还没看完就 timeout 了 |
36 monkeyblog 2019-08-26 18:12:58 +08:00 \w*(foo)\w* 已过 想问下 V2EX 怎么发图片?必须先把图片上传个服务器?不能上传本地的? |
![]() | 37 Biwood 2019-08-26 18:13:56 +08:00 @qqq8724 我也在质数这里卡了好久,最开始我以为规律是质数,但是看到 2 这个数字脑抽一下否定了质数规律。 刚刚看到你的回复有确认了一下确实是质数,按照质数的原理,这个题几分钟就解出来了。 提示:借鉴 abba 那道题即可。 |
38 zackwu 2019-08-26 18:23:46 +08:00 有趣,正则好难 ![]() |
![]() | 39 w99wen 2019-08-26 19:22:34 +08:00 foo |
![]() | 40 stcasshern 2019-08-26 19:34:38 +08:00 前五题:3 2 3 8 12,感觉很多取巧的方式。。。 |
![]() | 43 byron OP @stcasshern 第五题可以 9 |
![]() | 45 byron OP 我解到「 Triples 」,现在想砸键盘。 有 Cheat 吗? |
![]() | 46 hackshen 2019-08-27 09:09:56 +08:00 找规律中... |
![]() | 47 stcasshern 2019-08-27 09:12:09 +08:00 @byron 我觉得这个题目重点在于“找规律”而非正则实现,而现实中用到正则是已经知道规律或者规则,再用正则实现。 |
![]() | 49 jiejiss 2019-08-27 09:26:33 +08:00 ![]() @byron #45 ^([0369]|[258][0369]*[147]|([147]|[258][0369]*[258])([0369]|[147][0369]*[258])*([258]|[147][0369]*[147]))*$ DFA 转 regexp,可匹配所有 3 的正整数倍 |
50 Heanes 2019-08-27 09:27:24 +08:00 正则总在学总在忘。。。 |
51 leorealman 2019-08-27 09:27:24 +08:00 .* 直接梭哈 |
![]() | 52 sadfQED2 2019-08-27 09:35:24 +08:00 第一题全退,太难了。。。。回来看了回复才知道,原来都有 foo 啊 |
53 ahsjs 2019-08-27 10:02:46 +08:00 第三题 u\b 最简 3 个字符的尼玛 2 个字符怎么弄的 |
![]() | 54 Biwood 2019-08-27 10:13:57 +08:00 |
![]() | 57 hjq98765 2019-08-27 10:36:03 +08:00 好玩好玩,我试试 |
![]() | 58 Youngxj 2019-08-27 10:41:39 +08:00 只会两题 |
![]() | 59 index90 2019-08-27 10:43:50 +08:00 排行榜里用一个字符过关的是怎么回事? |
![]() | 60 hjq98765 2019-08-27 10:46:38 +08:00 |
61 a494836960 2019-08-27 10:55:44 +08:00 感觉更像找规则,,,写正则并不难 |
![]() | 64 daguaochengtang 2019-08-27 11:11:16 +08:00 我第 3 提就不会了,考零宽断言或者单词边界 |
![]() | 65 qq316107934 2019-08-27 11:28:15 +08:00 做到怀疑人生,regex 能匹配回文串吗? |
![]() | 66 qq316107934 2019-08-27 11:47:04 +08:00 Four 这道题,(.).\1.\1.\1 12 个字符,还能缩到 11 个吗,表示怀疑 |
![]() | 67 jsq2627 2019-08-27 11:56:11 +08:00 @qq316107934 #66 (.)(.\1){3} |
![]() | 68 byron OP @nikolausliu 单词边界就是语法,查一下就好了。 |
69 gerorim 2019-08-27 12:50:08 +08:00 ![]() @honjow #32 and none of these … xxxx (no match) xxxxxx (no match) xxxxxxxx (no match) xxxxxxxxx (no match) xxxxxxxxxx (no match) xxxxxxxxxxxx (no match) xxxxxxxxxxxxxx (no match) xxxxxxxxxxxxxxx (no match) xxxxxxxxxxxxxxxx (no match) xx …(18)… xx (no match) xx …(20)… xx (no match) xx …(21)… xx (no match) xx …(22)… xx (no match) xx …(24)… xx (no match) xx …(25)… xx (no match) xx …(26)… xx (no match) xx …(27)… xx (no match) xx …(28)… xx (no match) xx …(30)… xx (no match) xx …(32)… xx (no match) ^(?!(xx+)\1+$) https://sm.ms/image/E1Ppn3IyQJBC9HZ 注意上面的粉红色光标,断言后面的 xx...xx 串不能被 2 个以上的 xx+ 组成的重复串完全匹配,其中 xx+ 视作因数(数值>1 ),而反引用使得它不能被本身匹配。 联系质数的数学定义:大于 1 的自然数中,除了 1 和它本身以外不再有其他因数的自然数。 从上面的粉红光标处出发,再加两个 xx (确保自然数大于 1 )即为答案 Match all of these … xx xxx xxxxx xxxxxxx xxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxx …(18)… xx xxx …(22)… xx xxx …(28)… xx xxx …(30)… xx xxx …(36)… xx xxx …(40)… xx xxx …(42)… xx xxx …(46)… xx xxx …(52)… xx xxx …(58)… xx xxx …(60)… xx xxx …(66)… xx xxx …(70)… xx ^(?!(xx+)\1+$)xx |
70 gerorim 2019-08-27 12:53:27 +08:00 |
72 aaronchou0 2019-08-27 13:38:56 +08:00 这个跟正则关系不大吧,就是找规律 |
73 ahsjs 2019-08-27 13:57:04 +08:00 第七题 ^(.)(.).*\2\1$ 这个 14 个字符 13 个字符怎么破 |
75 silentsee 2019-08-27 14:40:21 +08:00 这个把正则里的元字符,范围,非,分组,负向引用,零宽断言,都练习了一遍,挺好的 |
![]() | 77 HGladIator 2019-08-27 14:51:48 +08:00 GitHub 一堆这个网站的答案, |
![]() | 78 rocketman13 2019-08-27 15:26:08 +08:00 @byron 第五题的 9 怎么写呀 |
![]() | 79 5200 2019-08-27 15:32:27 +08:00 |
80 cuiqiangtj 2019-08-27 15:38:31 +08:00 Long count (15 题)这题最简单,直接吧左边的贴上去就过关---哈哈 |
![]() | 81 asAnotherJack 2019-08-27 15:42:20 +08:00 @annielong #14 有思路了写起来还好,最抓狂的是读别人写的正则 |
![]() | 82 rocketman13 2019-08-27 16:02:54 +08:00 @shwomen1234fs ^(?!.*?(.)(.)\2\1)为什么最前面要加^ |
![]() | 83 rocketman13 2019-08-27 16:07:03 +08:00 @5200 原来[a-z]{3}换成(...) |
![]() | 84 freewind 2019-08-27 17:18:21 +08:00 Abba 怎么到 14 的 ^(?!.*(.)(.)\2\1) |
![]() | 85 anyuhanfei 2019-08-27 17:58:51 +08:00 真好玩,真难 |
![]() | 87 jlhxxxx 2019-08-28 09:01:34 +08:00 我也觉得这叫找规律,头秃头秃 |
88 chennqqi 2019-08-28 10:01:05 +08:00 好难 |
89 lightzh 2019-08-28 10:24:25 +08:00 |
![]() | 90 opsarno 2019-08-28 11:32:43 +08:00 老夫来试一试。 |
![]() | 91 opsarno 2019-08-28 11:51:09 +08:00 对不起,打扰了。 |
93 c0011 2019-08-28 12:55:50 +08:00 第三题怎么做? |
94 Chenamy2017 2019-08-28 13:06:59 +08:00 第一题看不懂,能看第二题吗 |