Converting ISBN-13 to ISBN-10
Retina,  44  39 28 bytes

&gt;,L3,-2`.+
.
$.&gt;`**
_{11}

_


Try it online!

Explanation

Time to show off some new Retina features. :)

&gt;,L3,-2`.+


We match the entire input with .+, return that match L, but select only the characters 3 (zero-based) to -2 (penultimate), inclusive. We also print the result without a trailing linefeed (&gt;).

Now, subtracting things in Retina is a bit annoying. But luckily, we're working modulo 11, so we can just invert the coefficients of the linear combination (mod 11) and add everything up. In other words, if the constraint is:

10*G + 9*G + 8*P + … + 3*T + 2*T + 1*c = 0 (mod 11)


then we get:

c = 1*G + 2*G + 3*P + … + 8*T + 9*T (mod 11)


That simplifies things a lot here:

.
$.&gt;`**


We replace each character with that thing at the bottom. * is Retina's repetition operator. It's right-associative and it has implicit operands $&amp; on the left and _ on the right, so the substitution is actually short for $.&gt;`*$&amp;*_. $&amp;*_ creates a string of d underscores, where d is the digit we're currently replacing. Then $.&gt;` is the length of the string up to and including the match.1 Hence, the entire expression results in a unary representation of the nth term of our linear combination.

_{11}



Doing the actual modulo is trivial in unary: we just drop all complete sets of 11 underscores.

_


Finally, we count how many underscores remain and print the result, which completes the ISBN-10.



1 How does $.&gt;` give the length of the string up to and including the match? You might be familiar with $` in regex substitutions, which gives you the string up to (but excluding) the match. By inserting a &gt;, we can shift the context of the $` to the separator between the current match and the next (which is an empty string between the current digit and the next). That separator's $` will include the current match. So $&gt;` is a shorter way to write $`$&amp;. Finally, for all $x-type substitution elements, Retina lets you insert a . after the $ to get its length.