

Every repeated substitution will count for 10 steps. Your primary score will be the number of substitution steps in your submission. (That is, it might also terminate if you find a match but the replacement is identical to the match.) Scoring Note that the termination criterion for loops is whether the string changes, not whether the regex found a match. Now the second substitution is applied in a loop until the string stops changing: 1|23,|456Īnd lastly, the third substitution is applied once: 111111 Given the input 123,456, this submission would process the input as follows: the first substitution is applied once and yields: |123,|456 Here is an example submission (which does not solve the above problem): Regex Modifiers Replacement Repeat? Optionally, for each of those steps in the sequence, you may choose to repeat the substitution until the string stops changing. The FormatĮvery answer should be a sequence of substitution steps, each step consisting of a regex and a replacement string. Your answer should work for arbitrary positive integers. We'll start simple: given a string containing two positive integers, as decimal numbers separated by a, produce a string containing their sum, also as as a decimal number.


To make this more possible and less of a chore, you will be allowed to apply several substitutions, one after the other. I want to try a new type of regex golf challenge, which asks you to solve nontrivial computational tasks with nothing but regex substitution.
