function indexOfFilter (input, filter, startingPos) {
  if (filter.indexOf('^') == -1) { // no separator characters, no need to do the rest of the parsing
    return input.indexOf(filter, startingPos)
  }
  if (filterArrCache[filter]) {
    var filterParts = filterArrCache[filter]
  } else {
    var filterParts = filter.split('^')
    filterArrCache[filter] = filterParts
  }
  var index = startingPos
  var beginIndex = -1
  var prefixedSeparatorChar = false

  var f = 0
  var part

  for (var f = 0; f < filterParts.length; f++) {
    part = filterParts[f]

    if (part === '') {
      prefixedSeparatorChar = true
      continue
    }

    index = input.indexOf(part, index)
    if (index === -1) {
      return -1
    }
    if (beginIndex === -1) {
      beginIndex = index
    }

    if (prefixedSeparatorChar) {
      if (separatorCharacters.indexOf(input[index - 1]) === -1) {
        return -1
      }
    }
    // If we are in an in between filterPart
    if (f + 1 < filterParts.length &&
      // and we have some chars left in the input past the last filter match
      input.length > index + part.length) {
      if (separatorCharacters.indexOf(input[index + part.length]) === -1) {
        return -1
      }
    }

    prefixedSeparatorChar = false
  }
  return beginIndex
}
Similar to str1.indexOf(filter, startingPos) but with
extra consideration to some ABP filter rules like ^.