Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 17216

For challenges which involve deciding whether or not the input meets certain criteria, and outputting some data, representing that decision.

1 vote

Determine whether strings are anagrams

Regex (.NET), 74 73 bytes ^(.)* ((.)(?<=(?=\3(?<-4>.*?(?<1>\4))*)(?<-1>\1.*(?=(.)?))* .*))*$(?(1)^) Try it online! - test cases Try it on regex101 - try it on your own This uses a completely differen …
Deadcode's user avatar
  • 11.9k
3 votes

Decide symmetry of fractions

Regex (ECMAScript), 112 104 bytes ^(x+),((?=\1*.*?(((x+)(?=\5$))*)x$)(?=.*(?=\1$)(x(x(x*)\8))(?=\6*$)\3\7*$)(?=.*(?=\1*$)(\1\8+$))\9x\3)*$ Takes denominator and numerator (in that order) from input in …
Deadcode's user avatar
  • 11.9k
2 votes

Is this a powerful number?

Regex (ECMAScript or better), 50 bytes ^((?=(xx+?)\2+$)((?=\2+$)(?=(x+)(\4+$))\5){2,})*x$ Try it online! - ECMAScript Try it online! - Perl Try it online! - Java Try it online! - Python Try it online …
Deadcode's user avatar
  • 11.9k
14 votes

Is this number a prime?

Regex (.NET), 604 517 499 469 455 bytes ^((?=[6-9](?<1>){6}|)(?=[3-59](?<1>){3}|)(?=[258](?<1>){2}|)(?=[147](?<1>)|).)+$(?<!(?=(?<-1>.)+(?(1)^))\11(?=((?<=(?=(?=((?<-2>)(?=.*$((?<-2>\2)(?<3>)|){9}).)+ …
Deadcode's user avatar
  • 11.9k
3 votes

Is it a completely even number?

Regex (Tcl ARE), 24 22 21 bytes ^((x((xx)*))\2*$)\3 - 19 bytes - Powers of 2 - Try it online! ^(x|(x((xx)*))\2*)$\3 - 21 bytes - Completely even - Try it online! Tcl ARE has both positive and negative …
Deadcode's user avatar
  • 11.9k
2 votes

Is it a completely even number?

Regex (PCRE1), 11 bytes ^(x(?1)?x|x)$ - 13 bytes - Powers of 2 ^(x(?1)?x)$ - 11 bytes - Completely even Regex engine Powers of 2 Completely even PCRE1 Try it online! Try it online! I'm not …
Deadcode's user avatar
  • 11.9k
2 votes

Is it a completely even number?

Regex (Java / Perl / PCRE / .NET), 12 bytes ^(\1\1|^x)*x$ - 13 bytes - Powers of 2 (\1\1|^x)+x$ - 12 bytes - Completely even Regex engine Powers of 2 Completely even Java Try it online! Try it …
Deadcode's user avatar
  • 11.9k
1 vote

Is it a super-prime?

Regex (.NET), 57 bytes ^(?=((?!(xx+)\2+$)(x+?))+x$)(?<-3>x){2,}(?<!\3|^\4+(x+x)) Try it online! This uses the .NET feature of balanced groups to do the prime counting, saving 3 bytes relative to the …
Deadcode's user avatar
  • 11.9k
3 votes

Recognize most smaller primes with a regex

.NET regex, 236 229 222 210 202 198 192 bytes ^(?!(?(((?<-4>(){10})|){99}((?<4-2>)|){990}(?=[6-9](?<4>){6})?(?=[3-59](?<4>){3})?([258](?<4>)|[147])?).)+$(?(5)|(\6)?()){31}(?(4)(?(6)(?<A-6>(?<-4>))){31 …
Deadcode's user avatar
  • 11.9k
0 votes

Does the start equal the end?

Regex (GNU ERE or better), 12 bytes ^(.)(.*\1)?$ This regex was already used in the following answers, shown in chronological order: eush77's 12 byte GNU grep answer (GNU ERE / PCRE) Neil's edited 1 …
Deadcode's user avatar
  • 11.9k
2 votes

Detect heat waves

JavaScript (ES6), 44 bytes a=>a.reduce((b,c)=>c<25?!!b:b*(2^c<30)%72,1) Try it online! This is based on Udo Borkowski's JavaScript answer which is 49 bytes. The extra golfs are: Change (c<30?2:6) to …
Deadcode's user avatar
  • 11.9k
2 votes

Detect heat waves

Regex (ECMAScript+(?^=)RME), 34 bytes ((:x{25,}){5,})(?^1=(:.*x{30}){3}) Takes its input in unary, as a concatenation of strings of x characters whose lengths represent the numbers, separated and enc …
Deadcode's user avatar
  • 11.9k
2 votes

Is this a Permutation of 1..n

Regex (ECMAScript+(?^=)RME), 37 30 28 bytes (:x*)x\b(.*\1x:|(?^!.*\1\b)) Takes its input in unary, as a concatenation of strings of x characters whose lengths represent the numbers, separated and enc …
Deadcode's user avatar
  • 11.9k
7 votes

Visible Dice Faces

Regex (Perl / Java / PCRE2 v10.34+), 30 29 27 bytes ^(?!.*:(x(\2?+:.*\b)?){7}:) Takes its input in unary, as a concatenation of strings of x characters whose lengths represent the numbers, separated …
Deadcode's user avatar
  • 11.9k
23 votes

Tut-tut-tut-tut-tut

Regex (POSIX ERE / RE2 or better), 23 21 20 bytes ^\b((t?\But)?-tut)+$ Based on regexes by thejonymyster and Bubbler. Try it on regex101! - RE2 Try it online! - GNU ERE (Bash + egrep) Try it online! …
Deadcode's user avatar
  • 11.9k

1
2 3 4 5 6
15 30 50 per page