3
\$\begingroup\$

This is the robbers' post. The cops' is here.

Your challenge is to take a cop's post and find an input that the regex matches but the program returns a falsey value.

Once you have cracked a cop's post, comment in a link to your crack. (If you don't have enough rep to comment, please say so, and someone will do it for you.) The robber with the most cracks wins.

Example

Let's say a cop's regex is (all of the flavors):

/^[0-9]$/

And the program is (JS):

x=>Boolean(parseInt(x))

Than a valid crack would be 0, because the regex matches 0 but 0 is falsey.

\$\endgroup\$
3
\$\begingroup\$

Python 3, pperry

İ

Try it online!

The lower case variant of this character is created by a an i and a ċȯṁḃi̇̇ṅi̇̇ṅġ ḋȯṫ which results in a length of 2.

\$\endgroup\$
  • \$\begingroup\$ That was the intended solution! \$\endgroup\$ – pppery Aug 29 '17 at 13:08
3
\$\begingroup\$

Python, ppperry

\n

Try it online!

. doesn't match newline by default.

\$\endgroup\$
2
\$\begingroup\$

JavaScript, ThePirateBay

Solution: 😩

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Java, Roman Gräf

is.is.is.is.

Try it online!

Most things which match the regex crack it, so I'm not sure if the regex is what was intended

\$\endgroup\$
  • \$\begingroup\$ I think the cop misunderstood the challenge, and that you misunderstood the regex : you're right that getting a false from the program while having the regex match is trivial, even more so than you think since (?is) is java's shorthand flag notation and turns on case-insensitivity and single-line mode for the rest of the regex, rather than the positive lookahead which it looks like you understood it as. (little illustration) \$\endgroup\$ – Aaron Aug 29 '17 at 16:34
  • \$\begingroup\$ @Aaron I've used those flags before so I really should have noticed that. If you would like to post an answer assuming the cop had true and false switches I encourage it since you spotted the intended answer \$\endgroup\$ – PunPun1000 Aug 29 '17 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.