function appendToken(from, to) {
    var targetText = string.slice(from, to);
    targetText && tokens.push(targetText);
  }
Decomposes the specified text into different tokens by running the regex against the text.