Pull to refresh

С регулярно наступающим Новым годом вас!

Reading time 1 min
Views 15K
Наткнувшись на занятную головоломку на тему регулярных выражений, конечно же я не смог пройти мимо:

regex.alf.nu

В честь наступающего Нового года я набрал в ней 2014 очков. Кто больше?

Мои варианты ответов
Plain strings
^(.*oo[^k])|foo$

Anchors
.+ick$

Ranges
^[a-f]{2,}[^m]$

Backrefs
(\w{3}).*\1.*

Abba
^(?!.*?(\w)\1).*$|ef

A man, a plan
^(\w)(\w).*\2\1$

Prime
^x(xx+?)\1+$

Four
(\w).*\1.*\1.*\1

Order
^[^o].{1,5}$

Triples
00

Glob
\*(\w+).+\S\1|(\w+)\*.+\1

Balance
((<)\2)\1

Power
^((((((((((x)\10?)\9?)\8?)\7?)\6?)\5?)\4?)\3?)\2?)\1?$

Tags:
Hubs:
If this publication inspired you and you want to support the author, do not hesitate to click on the button
+39
Comments 41
Comments Comments 41

Articles