Rock-Paper-Scissors Regex
(original problem formulation and solutions on codegolf.stackexchange.com)
Write three regexes R, P and S such that they match each other in a cyclic Rock, Paper, Scissors fashion. In particular, R matches S, S matches P and P matches R, but R doesn't match P, S doesn't match R and P doesn't match S.
Rock-Paper-Scissors-Lizard-Spock
For this challenge, you'll solve a tougher version of the above problem, based on the RPS variant Rock, Paper, Scissors, Lizard, Spock (as popularised by The Big Bang Theory). In RPSLV, there are five different symbols, that beat each other in two cycles:
- Rock → Scissors → Lizard → Paper → Spock → Rock
- Rock → Lizard → Spock → Scissors → Paper → Rock
You should write five regexes R, P, S, L and V which mimic this structure when given to each other as input.