/
(?(DEFINE)
(?<add> \s*\+\s* )
(?<eq> \s*=\s* )
# Remove all zeroes except the last one if the number is 0
(?<zero> (?:0(?=\d))*+ )
# cl: last digit of left operand being 1, cr: last digit of right operand being 1, \d(?:0|\b) check if last digit from result is 0
# there will be carry if cl and cr are set, or cl or cr are set and the last digit from result is 0
(?<carry> (?(cl)(?(cr)|\d(?:0|\b))|(?(cr)\d(?:0|\b)|(*F))) )
# add carry with l1 (current digit of left operand being 1) and r1 (current digit of right operand being 1)
# i.e. returns result of carry + l1 + r1 in Z/2Z
(?<digitadd> (?(?= (?(?=(?(l1)(?(r1)|(*F))|(?(r1)(*F))))(?&carry)|(?!(?&carry))) )1|0) )
# check for a single digit at the current offset whether the result is correct
# ro: right operand out of bounds (i.e. the current digit is at a higher offset than the size of the left operand)
# if we're out of bounds of the right operand, cr is just not set (i.e. handled as if there were leading zeroes)
(?<recursedigit>
# now, with the r and f, we can figure out r1 and cr at the current offset and also perform binary carry addition at that offset in the result
(?&add) (?&zero) (?:\d*(?:0|1(?<r1>)))? (?(ro)|(?=(?<cr>1)?))\k<r> (?&eq) \d*(?&digitadd)\k<f>\b
# iterate through the whole left operand to find the sequences (for right operand and result) of