Search Results
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 |
For challenges which involve deciding whether or not the input meets certain criteria, and outputting some data, representing that decision.
6
votes
Is there a face in this image?
Regex (PCRE2), 203 193 177 181 bytes
/((?|^()|^(?:.(?=.*
(\2.)))+){2}(?(8)(?=\8$)(?|()|(?:(?6)(?=.+((?6)\3)\7$))++){2}((?6)|(?!\5)7())\3(?=\7$)|o([^o7_])+o)(?|()|\7(?:.(?=.*
.*(.\7)))+){2}
(?=\2(.*))) …
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 …
1
vote
Check if simple regex matches string
Perl 5, 34 + -p flag = 35 bytes
Full program. Takes the simple regex pattern, followed by string to match against, from stdin as two separate lines, then loops and does it again, until EOF is encount …
6
votes
Find a Rocco number
Regex (ECMAScript), 64 62 bytes
^(?=(x((x{14})(x+)))(?=(\1*)\4\2*$)(\1*$\5))\6\3?(?!(xx+)\7+$)
Try it online!
Takes its input in unary, as a sequence of x characters whose length represents the numbe …
1
vote
In Search of a Soulmate
Regex (ECMAScript), 69 67 bytes
The input is in the form of a comma-delimited list of nonnegative integers in decimal.
^(?=.*\b(\w+\b).*,\1\b)(?!(.*\b\1\b){3}|.*\b(?!\1\b)(\w+\b).*,\3\b)
Try it onlin …
4
votes
Is it almost-prime?
Regex (ECMAScript), 35 33 32 bytes
-2 bytes thanks to H.PWiz; the explanation for why this worked was more complicated
-1 bytes by returning to the original algorithm (with its simple explanation), by …
5
votes
Is it a Lynch-Bell number?
Regex (ECMAScript), 194 171 167 164 155 145 142 107 bytes
-35 bytes (142 → 107) thanks to H.PWiz; this is a complete reimplementation. The primary sources of bytes saved are using tail = floor((tail + …
8
votes
Check B-powersmoothness
Regex (ECMAScript), 61 bytes
^(?=(|x*)\1*(?=\1\b)(?!(((x+)x+)(?=\3+,)\3*\4)\2+,)(x*)).*,\5
Try it online!
Takes \$n\$ and \$B\$ from input in unary as strings of xs whose length represents the number …
11
votes
Solve a 2xN Maze
Regex (POSIX ERE / RE2 or better), 13 10 bytes
x(|
|.
.)x
Try it online! - POSIX ERE
Try it on regex101 - RE2
Try it online! - ECMAScript
Try it online! - .NET
The problem statement didn't say anywhe …
8
votes
Do you make me up?
Regex (ECMAScript 2018 / Pythonregex / .NET), 20 bytes
Takes the two strings in joined format, delimited by a single newline. That is why there are two newlines in the regex itself (saving 2 bytes com …
2
votes
Is this number triangular?
Regex (ECMAScript), 37 bytes
Warning: Despite this regex's small size, it contains a major spoiler. I highly recommend learning how to solve unary mathematical problems in ECMAScript regex by figuring …
1
vote
Is it an Odd Word?
Regex (Perl / PCRE / Boost / Pythonregex) + /i flag, 24 bytes
^((.*?[aeiou]){2})*+(?2)
Returns a match if odd; returns no match if even.
Try it online! - Perl
Try it online! - PCRE
Try it online! - B …
1
vote
Determine if all decimal digits are unique
Regex (ECMAScript / Perl / PCRE / Python / .NET), 66 61 bytes
^(?!((?=(x{10})*(x*))(^|(?=(x*)(\5{9}x*))\6)+){2}\B\2*\3$)|^$
Takes its input in unary, as the length of a string of xs.
Try it online! - …
3
votes
Determining the winner of a Chess game
Python 3 (with python-chess)
Number of characters: 173 168 150 130
-5 characters thanks to Unrelated String
import io,chess.pgn as c
g=c.read_game(open(0))
b=g.board()
for m in g.mainline_moves():b.pu …
1
vote
Determine if all decimal digits are unique
See also my unary regex answer. Although other posts have already used a regex that take decimal input, this post provides a unified presentation, and outgolfs some of the previous posts (including a …