Skip to content
{{ message }}

Instantly share code, notes, and snippets.

# akouryy/:正規表現で加算(判定).md

Last active Nov 24, 2017
 ADD10 = / # A + B = C (? (?= (? [0-9] \g [0-9] | \+ .*? 0 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 1 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 2 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 3 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 4 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 5 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 6 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 7 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 8 ) \= )){0} (? (?= (? [0-9] \g [0-9] | \+ .*? 9 ) \= )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? (?= \g \$ )){0} (? 0 \g){0} (? 0 \g | 1 \g){0} (? 0 \g | 1 \g | 2 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g | 5 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g | 5 \g | 6 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g | 5 \g | 6 \g | 7 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g | 5 \g | 6 \g | 7 \g | 8 \g){0} (? 0 \g | 1 \g | 2 \g | 3 \g | 4 \g | 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 1 \g | 2 \g | 3 \g | 4 \g | 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 2 \g | 3 \g | 4 \g | 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 3 \g | 4 \g | 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 4 \g | 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 5 \g | 6 \g | 7 \g | 8 \g | 9 \g){0} (? 6 \g | 7 \g | 8 \g | 9 \g){0} (? 7 \g | 8 \g | 9 \g){0} (? 8 \g | 9 \g){0} (? 9 \g){0} (? (?= \g*+ (?: \g | \g | \g | \g | \g | \g | \g | \g | \g | \+ ))){0} (? (?= \g*+ (?: \g | \g | \g | \g | \g | \g | \g | \g | \g ))){0} ^ \g (?: (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g | \g) \g \g | (?: \g ) \g \g | (?: \g ) \g \g )++ \+ [0-9]++ \= [0-9]++ \$ /x
 ADD2 = / # A + B = C (? (?= (? [01] \g [01] | \+ .*? 0 ) \= )){0} (? (?= (? [01] \g [01] | \+ .*? 1 ) \= )){0} (? (?= (? [01] \g [01] | \+ .*? 0 ) \$ )){0} (? (?= (? [01] \g [01] | \+ .*? 1 ) \$ )){0} (? (?= (?: 1 \g | 0 \g )*+ (?: 0 \g | \+ ))){0} (? (?= (?: 1 \g | 0 \g )*+ 1 \g )){0} ^ \g (?: 0 \g \g \g | 0 \g \g \g | 0 \g \g \g | 0 \g \g \g | 1 \g \g \g | 1 \g \g \g | 1 \g \g \g | 1 \g \g \g )++ \+ [01]++ \= [01]++ \$ /x
to join this conversation on GitHub. Already have an account? Sign in to comment