📜 ⬆️ ⬇️

Happy New Year to you!

Having come across an entertaining puzzle on the topic of regular expressions, of course, I could not pass by:

regex.alf.nu

In honor of the upcoming New Year, I scored 2014 points in it. Who is bigger?
')
My answer choices
Plain strings
^(.*oo[^k])|foo$ 

Anchors
 .+ick$ 

Ranges
 ^[af]{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?$ 

Source: https://habr.com/ru/post/206858/


All Articles