in reply to Regex + substring

I'd lowercase both strings, use index to find where the second one matches in the first, and then it's a matter of using substr (and length) to get the missing parts.

However, I do not understand the purpose of the "-" character. You make a point of telling that this character can be present in "the string" (which one? either?), but don't tell us whether this character has any special meaning.