I forgot to add:
+ else + { + if (pos < 1 || pos > (stringlen + 1))+ runtime_error ("If BACK is present with the value true, the value of "+ "POS shall be in the range [1, LEN (STRING) + 1]"); +
can you provide the value of pos and stringlen in the error messages?